RequestConsumer

Package: inet.queueing.sink

RequestConsumer

compound module

This module processes incoming packets one by one in the order they arrive. First it classifies a packet according to the configured classifier function, then it generates tokens for the selected category in the configured response producer.

See also: ResponseProducer

queue : like IPacketQueue

PacketQueue: This module implements a widely configurable packet queue, which is suitable among others, to be...

IPacketQueue: This module interface is implemented by packet queue modules.

Source:
queue: <default("PacketQueue")> like IPacketQueue {
    @display("p=200,100");
} server : like IPacketServer

TokenBasedServer: This module repeatedly pulls packets from the connected packet provider and it pushes them into the...

IPacketServer: This module interface is implemented by packet server modules.

Source:
server: <default("TokenBasedServer")> like IPacketServer {
    initialNumTokens = default(1);
    @display("p=200,225");
} classifier : like IPacketClassifier

PacketClassifier: This module connects one packet producer to multiple packet consumers.

IPacketClassifier: This module interface is implemented by packet classifier modules.

Source:
classifier: <default("PacketClassifier")> like IPacketClassifier {
    @display("p=200,350");
} tokenGenerator[numKind] : like IPassivePacketSink

PacketBasedTokenGenerator: This module generates tokens into the configured ~TokenBasedServer for each consumed packet.

IPassivePacketSink: This module interface must be implemented by passive packet sink modules.

Source:
tokenGenerator[numKind]: <default("PacketBasedTokenGenerator")> like IPassivePacketSink {
    storageModule = default("^." + parent.responseProducerModule + ".server[" + string(index) + "]");
    @display("p=200,475,row,300");
}

Usage diagram

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Parameters

Name Type Default value Description
numKind int
responseProducerModule string "^.source"

Properties

Name Value Description
display i=block/sink

Gates

Name Direction Size Description
in input

Source code

//
// This module processes incoming packets one by one in the order they arrive.
// First it classifies a packet according to the configured classifier function,
// then it generates tokens for the selected category in the configured response
// producer.
//
// @see ~ResponseProducer
//
module RequestConsumer like IPassivePacketSink
{
    parameters:
        int numKind;
        string responseProducerModule = default("^.source");
        @display("i=block/sink");
    gates:
        input in;
    submodules:
        queue: <default("PacketQueue")> like IPacketQueue {
            @display("p=200,100");
        }
        server: <default("TokenBasedServer")> like IPacketServer {
            initialNumTokens = default(1);
            @display("p=200,225");
        }
        classifier: <default("PacketClassifier")> like IPacketClassifier {
            @display("p=200,350");
        }
        tokenGenerator[numKind]: <default("PacketBasedTokenGenerator")> like IPassivePacketSink {
            storageModule = default("^." + parent.responseProducerModule + ".server[" + string(index) + "]");
            @display("p=200,475,row,300");
        }
    connections:
        in --> queue.in;
        queue.out --> server.in;
        server.out --> classifier.in;
        for i=0..sizeof(tokenGenerator) - 1 {
            classifier.out++ --> tokenGenerator[i].in;
        }
}
File: src/inet/queueing/sink/RequestConsumer.ned