Worker that performs some action when the worker is started and/or stopped.
Facilities for a Workflow to interact with other Workflows and the outside world from inside a
An object that receives values (commonly events or WorkflowAction). Use RenderContext.makeActionSink to create instances.
A lazy wrapper of ByteString. Allows Workflows to capture their state frequently, without worrying about performing unnecessary serialization work.
A composable, stateful object that can handle events, delegate to children, subscribe to arbitrary asynchronous events from the outside world, and be saved to a serialized form to be restored later.
Minimal implementation of Workflow that maintains no state of its own.
Represents a unit of asynchronous work that can have zero, one, or multiple outputs.
A composable, optionally-stateful object that can handle events, delegate to children, subscribe to arbitrary asynchronous events from the outside world.
A function that can change the current state of a Workflow by returning a new one, and also optionally emit an output.
Marks Workflow APIs that are extremely likely to change in future versions, rely themselves on other unstable, experimental APIs, and SHOULD NOT be used in production code. Proceed with caution, and be ready to have the rug pulled out from under you.
Extensions for External Classes¶
Generates a new sink of type T2.
EventHandlers of type
Alternative to RenderContext.makeActionSink that allows externally defined event types to be mapped to anonymous WorkflowActions.
Uses the given function to transform a Workflow that renders FromRenderingT to one renders ToRenderingT,
Convenience alias of RenderContext.renderChild for workflows that don’t take input.
Convenience alias of RenderContext.renderChild for workflows that don’t take input or emit output.
Ensures worker is running. When the Worker emits an output, handler is called to determine the WorkflowAction to take. When the worker finishes, nothing happens (although another render pass may be triggered).
Ensures a Worker that never emits anything is running. Since worker can’t emit anything, it can’t trigger any WorkflowActions.
Returns a Worker that transforms this Worker‘s Flow by calling transform.
Companion Object Functions¶
Returns a workflow that does nothing but echo the given rendering. Handy for testing.
Returns a stateful Workflow implemented via the given functions.
Returns a stateful Workflow, with no props, implemented via the given functions.
Returns a stateful Workflow, with no props, implemented via the given function.
Returns a stateless Workflow via the given render function.