Class InsertIntoLatchWait
java.lang.Object
com.espertech.esper.common.internal.statement.insertintolatch.InsertIntoLatchWait
- All Implemented Interfaces:
InsertIntoLatch
A suspend-and-notify implementation of a latch for use in guaranteeing delivery between
a single event produced by a single statement and consumable by another statement.
-
Constructor Summary
ConstructorDescriptionCtor - use for the first and unused latch to indicate completion.InsertIntoLatchWait
(InsertIntoLatchFactory factory, InsertIntoLatchWait earlier, long msecTimeout, EventBean payload) Ctor. -
Method Summary
Modifier and TypeMethodDescriptionawait()
Blcking call that returns only when the earlier latch completed.void
done()
Called to indicate that the latch completed and a later latch can start.getEvent()
boolean
Returns true if the dispatch completed for this future.void
void
setLater
(InsertIntoLatchWait later) Hand a later latch to use for indicating completion via notify.
-
Constructor Details
-
InsertIntoLatchWait
public InsertIntoLatchWait(InsertIntoLatchFactory factory, InsertIntoLatchWait earlier, long msecTimeout, EventBean payload) Ctor.- Parameters:
earlier
- the latch before this latch that this latch should be waiting formsecTimeout
- the timeout after which delivery occurspayload
- the payload is an event to deliverfactory
- the factory originating the latch
-
InsertIntoLatchWait
Ctor - use for the first and unused latch to indicate completion.- Parameters:
factory
- the latch factory
-
-
Method Details
-
isCompleted
public boolean isCompleted()Returns true if the dispatch completed for this future.- Returns:
- true for completed, false if not
-
setLater
Hand a later latch to use for indicating completion via notify.- Parameters:
later
- is the later latch
-
await
Blcking call that returns only when the earlier latch completed.- Returns:
- payload of the latch
-
done
public void done()Called to indicate that the latch completed and a later latch can start. -
getFactory
- Specified by:
getFactory
in interfaceInsertIntoLatch
-
setEvent
- Specified by:
setEvent
in interfaceInsertIntoLatch
-
getEvent
- Specified by:
getEvent
in interfaceInsertIntoLatch
-