Interface QueueProducer<E>
-
Method Summary
Modifier and TypeMethodDescriptionbooleancancellableOffer(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.voidcancellablePut(E e) Inserts the specified element into this queue, waiting if necessary for space to become available.booleanInserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions, returningtrueupon success andfalseif no space is currently available.booleanInserts the specified element into this queue, waiting up to the specified wait time if necessary for space to become available.voidInserts the specified element into this queue, waiting if necessary for space to become available.
-
Method Details
-
offer
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions, returningtrueupon success andfalseif no space is currently available.- Parameters:
e- the element to add- Returns:
trueif the element was added to this queue, elsefalse- Throws:
ClassCastException- if the class of the specified element prevents it from being added to this queueNullPointerException- if the specified element is nullIllegalArgumentException- if some property of the specified element prevents it from being added to this queue
-
put
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. UsecancellablePut(Object)instead.- Parameters:
e- the element to add- Throws:
ClassCastException- if the class of the specified element prevents it from being added to this queueNullPointerException- if the specified element is nullIllegalArgumentException- if some property of the specified element prevents it from being added to this queue
-
cancellablePut
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 @CancellationScopeis canceled while waitingClassCastException- if the class of the specified element prevents it from being added to this queueNullPointerException- if the specified element is nullIllegalArgumentException- if some property of the specified element prevents it from being added to this queue
-
offer
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. UsecancellableOffer(Object, Duration)instead.- Parameters:
e- the element to addtimeout- how long to wait before giving up- Returns:
trueif successful, orfalseif 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 queueNullPointerException- if the specified element is nullIllegalArgumentException- if some property of the specified element prevents it from being added to this queue
-
cancellableOffer
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 addtimeout- how long to wait before giving up- Returns:
trueif successful, orfalseif the specified waiting time elapses before space is available- Throws:
CanceledFailure- if surrounding @CancellationScopeis canceled while waitingClassCastException- if the class of the specified element prevents it from being added to this queueNullPointerException- if the specified element is nullIllegalArgumentException- if some property of the specified element prevents it from being added to this queue
-