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 Details

    • proxyInstance

      E proxyInstance(E impl)
      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

      int process(E impl, int limit)
      Parameters:
      impl - into which the calls are made where they are not for a proxy instance
      limit - 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()