Skip to main content

Awaiting Time

Timers are crucial for workflows that need to introduce delays, implement timeouts, or schedule future actions. This operation enables time-based coordination, allowing workflows to pause for specific durations or until a scheduled time.

val waitForInput: WIO[MyState, Nothing, MyState] =
WIO
.await[MyState](1.day)
.persistStartThrough(start => MyTimerStarted(start.at))(evt => evt.time)
.persistReleaseThrough(release => MyTimerReleased(release.at))(evt => evt.time)
.autoNamed
Rendering Outputs