Interface QueueProducer<E>

All Known Subinterfaces:
WorkflowQueue<E>

public interface QueueProducer<E>
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Inserts the specified element into this queue, waiting up to the specified wait time if necessary for space to become available.
    void
    Inserts the specified element into this queue, waiting if necessary for space to become available.
    boolean
    offer(E e)
    Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions, returning true upon success and false if no space is currently available.
    boolean
    offer(E e, Duration timeout)
    Inserts the specified element into this queue, waiting up to the specified wait time if necessary for space to become available.
    void
    put(E e)
    Inserts the specified element into this queue, waiting if necessary for space to become available.
  • Method Details

    • offer

      boolean offer(E e)
      Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions, returning true upon success and false if no space is currently available.
      Parameters:
      e - the element to add
      Returns:
      true if the element was added to this queue, else false
      Throws:
      ClassCastException - if the class of the specified element prevents it from being added to this queue
      NullPointerException - if the specified element is null
      IllegalArgumentException - if some property of the specified element prevents it from being added to this queue
    • put

      void put(E e)
      Inserts the specified element into this queue, waiting if necessary for space to become available. It is not unblocked in case of the enclosing CancellationScope cancellation. Use cancellablePut(Object) instead.
      Parameters:
      e - the element to add
      Throws:
      ClassCastException - if the class of the specified element prevents it from being added to this queue
      NullPointerException - if the specified element is null
      IllegalArgumentException - if some property of the specified element prevents it from being added to this queue
    • cancellablePut

      void cancellablePut(E e)
      Inserts the specified element into this queue, waiting if necessary for space to become available.
      Parameters:
      e - the element to add
      Throws:
      CanceledFailure - if surrounding @CancellationScope is canceled while waiting
      ClassCastException - if the class of the specified element prevents it from being added to this queue
      NullPointerException - if the specified element is null
      IllegalArgumentException - if some property of the specified element prevents it from being added to this queue
    • offer

      boolean offer(E e, Duration timeout)
      Inserts the specified element into this queue, waiting up to the specified wait time if necessary for space to become available. It is not unblocked in case of the enclosing CancellationScope cancellation. Use cancellableOffer(Object, Duration) instead.
      Parameters:
      e - the element to add
      timeout - how long to wait before giving up
      Returns:
      true if successful, or false if the specified waiting time elapses before space is available
      Throws:
      ClassCastException - if the class of the specified element prevents it from being added to this queue
      NullPointerException - if the specified element is null
      IllegalArgumentException - if some property of the specified element prevents it from being added to this queue
    • cancellableOffer

      boolean cancellableOffer(E e, Duration timeout)
      Inserts the specified element into this queue, waiting up to the specified wait time if necessary for space to become available.
      Parameters:
      e - the element to add
      timeout - how long to wait before giving up
      Returns:
      true if successful, or false if the specified waiting time elapses before space is available
      Throws:
      CanceledFailure - if surrounding @CancellationScope is canceled while waiting
      ClassCastException - if the class of the specified element prevents it from being added to this queue
      NullPointerException - if the specified element is null
      IllegalArgumentException - if some property of the specified element prevents it from being added to this queue