Skip to content

Emil B
Sep 19, 20201 min read

1.1.0: Add Readiness state

Changes:

  • Add a new Ready() method to the main State interface. It returns a channel that is closed once all background jobs are ready. If the tree contains no states that support readiness, the channel is closed automatically after the tree has been traversed.
  • Add a new WithReadiness state initializer. It returns a new State and a ReadinessTail interface.
    The ReadinessTail should remain owned by the background job associated with the created State, as it carries the readiness signal.

    ReadinessTail has a single method -Ok(). It signals that the background job is ready. If Ok() is never called, readiness will remain blocked for all parent states, and the channel returned by State.Ready() will never be closed.

Did you enjoy this article?

Recommend it — Standard Reader surfaces well-loved writing to more readers across the network.

Across the AtmosphereDiscussions