Package com.uber.cadence.workflow
Interface QueueProducer<E>
-
- All Known Subinterfaces:
WorkflowQueue<E>
public interface QueueProducer<E>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
offer(E e)
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions, returningtrue
upon success andfalse
if no space is currently available.boolean
offer(E e, long timeout, java.util.concurrent.TimeUnit unit)
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 Detail
-
offer
boolean offer(E e)
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions, returningtrue
upon success andfalse
if no space is currently available.- Parameters:
e
- the element to add- Returns:
true
if the element was added to this queue, elsefalse
- Throws:
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 queue
-
put
void put(E e) throws java.lang.InterruptedException
Inserts the specified element into this queue, waiting if necessary for space to become available.- Parameters:
e
- the element to add- Throws:
java.lang.InterruptedException
- if interrupted 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
-
offer
boolean offer(E e, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
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, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
true
if successful, orfalse
if the specified waiting time elapses before space is available- Throws:
java.lang.InterruptedException
- if interrupted 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
-
-