Interface MessagePassingQueue<M>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean isEmpty()
      This method's accuracy is subject to concurrent modifications happening as the observation is carried out.
      boolean offer​(M message)
      Called from a producer thread subject to the restrictions appropriate to the implementation and according to the Queue.offer(Object) interface.
      M peek()
      Called from the consumer thread subject to the restrictions appropriate to the implementation and according to the Queue.peek() interface.
      M poll()
      Called from the consumer thread subject to the restrictions appropriate to the implementation and according to the Queue.poll() interface.
      int size()
      This method's accuracy is subject to concurrent modifications happening as the size is estimated and as such is a best effort rather than absolute value.
    • Method Detail

      • offer

        boolean offer​(M message)
        Called from a producer thread subject to the restrictions appropriate to the implementation and according to the Queue.offer(Object) interface.
        Parameters:
        message -
        Returns:
        true if element was inserted into the queue, false iff full
      • poll

        M poll()
        Called from the consumer thread subject to the restrictions appropriate to the implementation and according to the Queue.poll() interface.
        Returns:
        a message from the queue if one is available, null iff empty
      • peek

        M peek()
        Called from the consumer thread subject to the restrictions appropriate to the implementation and according to the Queue.peek() interface.
        Returns:
        a message from the queue if one is available, null iff empty
      • size

        int size()
        This method's accuracy is subject to concurrent modifications happening as the size is estimated and as such is a best effort rather than absolute value. For some implementations this method may be O(n) rather than O(1).
        Returns:
        number of messages in the queue, between 0 and queue capacity or Integer.MAX_VALUE if not bounded
      • isEmpty

        boolean isEmpty()
        This method's accuracy is subject to concurrent modifications happening as the observation is carried out.
        Returns:
        true if empty, false otherwise