Package-level declarations
Types
Result of applying an action.
An ActionProcessingResult is any possible outcome after the runtime does a loop of processing.
If your Workflow caches its WorkflowIdentifier (to avoid frequent lookups) then implement this interface. Note that StatefulWorkflow and StatelessWorkflow already implement this, so you only need to do so if you do not extend one of those classes.
Optional interface that Workflows should implement if they need the runtime to consider their identity to include a child workflow's identity. Two ImpostorWorkflows with the same concrete class, but different realIdentifiers will be considered different workflows by the runtime.
Worker that performs some action when the worker is started and/or stopped.
Used to wrap immutable nullable values whose holder may not yet be initialized. Check isInitialized to see if the value has been assigned.
A specification of the possible Workflow Runtime options.
An extension of StatefulWorkflow that gives initialState a CoroutineScope that corresponds with the lifetime of session driven by this Workflow.
An object that receives values (commonly events or WorkflowAction). BaseRenderContext.actionSink implements this interface.
Minimal implementation of Workflow that maintains no state of its own.
Convenience alias for working with WorkflowAction.Updater.
A composable, optionally-stateful object that can handle events, delegate to children, subscribe to arbitrary asynchronous events from the outside world.
An atomic operation that updates the state of a Workflow, and also optionally emits an output.
This is used to mark new core Workflow API that is still considered experimental.
This is used to mark any experimental runtimes.
Represents a Workflow's "identity" and is used by the runtime to determine whether a workflow is the same as one that was rendered in a previous render pass, in which case its state should be re-used; or if it's a new workflow and needs to be started.
Represents a subset of KAnnotatedElement, namely KClass or KType. Used by the runtime to determine whether a WorkflowIdentifier, and thus the Workflow it identifies, is serializable or not via the Snapshot mechanism.
Box around a potentially nullable OutputT
This is a very simple tracing interface that can be passed into a workflow runtime in order to inject span tracing throughout the workflow core and runtime internals.
Properties
The computed WorkflowIdentifier for this Workflow. Any IdCacheable Workflow should call this and then store the value in the cachedIdentifier property so as to prevent the extra work needed to create the WorkflowIdentifier and look up the class name each time.
The WorkflowIdentifier that identifies this Workflow.
The WorkflowIdentifier that identifies the workflow this KClass represents.
Functions
Creates a WorkflowAction from the apply lambda. The returned object will include the string returned from name in its toString.
Convenience to create a WorkflowAction with parameter types matching those of the receiving StatefulWorkflow. The action will invoke the given lambda when it is applied.
Collects from a Flow by converting each item into a WorkflowAction and then sending them to the actionSink. This may be used as an alternative to a asWorker for certain Flows.
Uses the given function to transform a Workflow that renders FromRenderingT to one renders ToRenderingT,
Remember the value calculated by the calculation lambda. The calculation will be run the first time, and on any subsequent render pass where the inputs have changed.
Convenience alias of BaseRenderContext.renderChild for children that don't take props or emit output.
Convenience alias of BaseRenderContext.renderChild for workflows that don't emit output.
Convenience alias of BaseRenderContext.renderChild for workflows that don't take props.
Creates a RenderContext
from a BaseRenderContext for the given StatelessWorkflow.
Creates a RenderContext
from a BaseRenderContext for the given StatefulWorkflow.
Returns a workflow that does nothing but echo the given rendering. Handy for testing.
Ensures a LifecycleWorker is running. Since worker can't emit anything, it can't trigger any WorkflowActions.
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).
Returns a SessionWorkflow, with no props, implemented via the given function.
Returns a SessionWorkflow implemented via the given functions.
Returns a SessionWorkflow, with no props, implemented via the given functions.
Returns a stateful Workflow, with no props, implemented via the given function.
Returns a stateful Workflow implemented via the given functions.
Returns a stateful Workflow, with no props, implemented via the given functions.
Convenience function to wrap block with a trace span as defined by WorkflowTracer. This wraps very frequently evaluated code and we should only use constants for label, with no interpolation.
Creates a WorkflowIdentifier that is not capable of being snapshotted and will cause any ImpostorWorkflow workflow identified by it to also not be snapshotted.