java.lang.Object
com.espertech.esper.common.internal.statement.insertintolatch.InsertIntoLatchSpin
All Implemented Interfaces:
InsertIntoLatch

public class InsertIntoLatchSpin extends Object implements InsertIntoLatch
A spin-locking implementation of a latch for use in guaranteeing delivery between a single event produced by a single statement and consumable by another statement.
  • Constructor Details

    • InsertIntoLatchSpin

      public InsertIntoLatchSpin(InsertIntoLatchFactory factory, InsertIntoLatchSpin earlier, long msecTimeout, EventBean payload)
      Ctor.
      Parameters:
      factory - the latch factory
      earlier - the latch before this latch that this latch should be waiting for
      msecTimeout - the timeout after which delivery occurs
      payload - the payload is an event to deliver
    • InsertIntoLatchSpin

      public InsertIntoLatchSpin(InsertIntoLatchFactory factory)
      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
    • await

      public EventBean await()
      Blocking 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

      public InsertIntoLatchFactory getFactory()
      Specified by:
      getFactory in interface InsertIntoLatch
    • getEvent

      public EventBean getEvent()
      Specified by:
      getEvent in interface InsertIntoLatch
    • setEvent

      public void setEvent(EventBean event)
      Specified by:
      setEvent in interface InsertIntoLatch