Search in sources :

Example 1 with ThrottleRequest

use of com.swiftmq.impl.routing.single.smqpr.v942.ThrottleRequest in project swiftmq-ce by iitsoftware.

the class ThrottleQueue method process.

protected void process(Object[] objects, int len) {
    for (int i = 0; i < len; i++) {
        Request r = (Request) objects[i];
        if (r.getDumpId() == SMQRFactory.THROTTLE_REQ) {
            sem.reset();
            sem.waitHere(((ThrottleRequest) r).getDelay());
        } else {
            outboundQueue.enqueue(r);
        }
        if (closed)
            return;
    }
}
Also used : ThrottleRequest(com.swiftmq.impl.routing.single.smqpr.v942.ThrottleRequest) Request(com.swiftmq.tools.requestreply.Request)

Example 2 with ThrottleRequest

use of com.swiftmq.impl.routing.single.smqpr.v942.ThrottleRequest in project swiftmq-ce by iitsoftware.

the class ThrottleQueue method process.

protected void process(Object[] objects, int len) {
    for (int i = 0; i < len; i++) {
        Request r = (Request) objects[i];
        if (r.getDumpId() == SMQRFactory.THROTTLE_REQ) {
            sem.reset();
            sem.waitHere(((ThrottleRequest) r).getDelay());
        } else {
            outboundQueue.enqueue(r);
        }
        if (closed)
            return;
    }
}
Also used : Request(com.swiftmq.tools.requestreply.Request) ThrottleRequest(com.swiftmq.impl.routing.single.smqpr.v400.ThrottleRequest)

Aggregations

Request (com.swiftmq.tools.requestreply.Request)2 ThrottleRequest (com.swiftmq.impl.routing.single.smqpr.v400.ThrottleRequest)1 ThrottleRequest (com.swiftmq.impl.routing.single.smqpr.v942.ThrottleRequest)1