1package dev.advo.fs.dispatch;
3import java.util.concurrent.BlockingQueue;
4import java.util.concurrent.PriorityBlockingQueue;
6import org.jboss.netty.channel.Channel;
8import dev.advo.fs.net.ondemand.OnDemandRequest;
24 private static final BlockingQueue<ChannelRequest<OnDemandRequest>>
onDemandQueue =
new PriorityBlockingQueue<ChannelRequest<OnDemandRequest>>();
A specialised request which contains a channel as well as the request object itself.
RequestDispatcher()
Default private constructor to prevent instantiation.
static void dispatch(Channel channel, OnDemandRequest request)
Dispatches an 'on-demand' request.
static ChannelRequest< OnDemandRequest > nextOnDemandRequest()
Gets the next 'on-demand' request from the queue, blocking if none are available.
static final int MAXIMUM_QUEUE_SIZE
The maximum size of a queue before requests are rejected.
static final BlockingQueue< ChannelRequest< OnDemandRequest > > onDemandQueue
A queue for pending 'on-demand' requests.