Package org.jctools.channels.proxy
Interface ProxyChannel<E>
- Type Parameters:
E
- element type
public interface ProxyChannel<E>
A minimal top level queue interface which allows producer/consumers access via separate interfaces.
Channels may determine their capacity themselves with additional slack or resize themselves as powers of two etc.
Consequently instead of having a definite concept of a "capacity" channels have a requested capacity and a maximum
capacity. The requested capacity is the capacity requested when you create the channel and the maximum capacity is the
size that the channel has resized itself up to.
-
Method Summary
-
Method Details
-
proxyInstance
- Parameters:
impl
- the accept function for this consumer- Returns:
- a consumer instance to be used for this particular thread.
-
proxy
E proxy()- Returns:
- a producer instance to be used for this particular thread.
-
process
- Parameters:
impl
- into which the calls are made where they are not for a proxy instancelimit
- maximum number of calls to process through- Returns:
- the number of calls processed
-
size
int size()- Returns:
- the number of calls in the queue.
-
capacity
int capacity()- Returns:
- the maximum number of calls that can fit in this channel.
-
isEmpty
boolean isEmpty()
-