public interface QueueProducer<E>
Modifier and Type | Method and Description |
---|---|
boolean |
cancellableOffer(E e,
java.time.Duration timeout)
Inserts the specified element into this queue, waiting up to the specified wait time if
necessary for space to become available.
|
void |
cancellablePut(E e)
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,
java.time.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.
|
boolean offer(E e)
true
upon success and false
if no
space is currently available.e
- the element to addtrue
if the element was added to this queue, else false
java.lang.ClassCastException
- if the class of the specified element prevents it from being added
to this queuejava.lang.NullPointerException
- if the specified element is nulljava.lang.IllegalArgumentException
- if some property of the specified element prevents it from
being added to this queuevoid put(E e)
cancellablePut(Object)
instead.e
- the element to addjava.lang.ClassCastException
- if the class of the specified element prevents it from being added
to this queuejava.lang.NullPointerException
- if the specified element is nulljava.lang.IllegalArgumentException
- if some property of the specified element prevents it from
being added to this queuevoid cancellablePut(E e)
e
- the element to addCanceledFailure
- if surrounding @CancellationScope
is
canceled while waitingjava.lang.ClassCastException
- if the class of the specified element prevents it from being added
to this queuejava.lang.NullPointerException
- if the specified element is nulljava.lang.IllegalArgumentException
- if some property of the specified element prevents it from
being added to this queueboolean offer(E e, java.time.Duration timeout)
cancellableOffer(Object, Duration)
instead.e
- the element to addtimeout
- how long to wait before giving uptrue
if successful, or false
if the specified waiting time elapses
before space is availablejava.lang.ClassCastException
- if the class of the specified element prevents it from being added
to this queuejava.lang.NullPointerException
- if the specified element is nulljava.lang.IllegalArgumentException
- if some property of the specified element prevents it from
being added to this queueboolean cancellableOffer(E e, java.time.Duration timeout)
e
- the element to addtimeout
- how long to wait before giving uptrue
if successful, or false
if the specified waiting time elapses
before space is availableCanceledFailure
- if surrounding @CancellationScope
is
canceled while waitingjava.lang.ClassCastException
- if the class of the specified element prevents it from being added
to this queuejava.lang.NullPointerException
- if the specified element is nulljava.lang.IllegalArgumentException
- if some property of the specified element prevents it from
being added to this queue