Interface DiscardAwareExecution

All Superinterfaces:
Consumer<ExecutionContext>, Serializable, SerializableConsumer<ExecutionContext>

public interface DiscardAwareExecution extends SerializableConsumer<ExecutionContext>
An execution registered through StateTree.beforeClientResponse(StateNode, SerializableConsumer) that wants to know when the tree stops and starts waiting to run it.

For internal use only. May be renamed or removed in a future release.

Since:
25.3
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called when the state tree stops waiting to run this execution before a response, which happens when the node it was registered for is detached from the tree, and when the execution is flushed for a tree that it cannot run in because its node has been moved to another one.
    void
    Called when the node this execution was registered for is attached to the state tree, so that the tree waits to run it before the next response.

    Methods inherited from interface java.util.function.Consumer

    accept, andThen
  • Method Details

    • executionDiscarded

      void executionDiscarded()
      Called when the state tree stops waiting to run this execution before a response, which happens when the node it was registered for is detached from the tree, and when the execution is flushed for a tree that it cannot run in because its node has been moved to another one.

      A detached node keeps its pending executions, so this may be called for an execution that is still run later, when the node is attached to the same tree again.

    • executionRestored

      void executionRestored()
      Called when the node this execution was registered for is attached to the state tree, so that the tree waits to run it before the next response.

      This is also called for an execution that has not been discarded, since an execution can be registered for a node that is not attached to any tree yet. It does not promise that the execution is run either: one that cannot run in the tree its node was attached to is discarded again when it is flushed.