Package com. squareup. workflow1
Types
Noop Workflow Interceptor
Link copied to clipboard
A WorkflowInterceptor that does not intercept anything.
Rendering And Snapshot
Link copied to clipboard
class RenderingAndSnapshot<out RenderingT>(rendering: RenderingT, snapshot: TreeSnapshot)
Content copied to clipboard
Tuple of rendering and snapshot used by renderWorkflowIn.
Runtime Config
Link copied to clipboard
interface RuntimeConfig
Content copied to clipboard
A specification of the Workflow Runtime.
Simple Logging Workflow Interceptor
Link copied to clipboard
A WorkflowInterceptor that just prints all method calls using log.
Tree Snapshot
Link copied to clipboard
class TreeSnapshot
Content copied to clipboard
Aggregate of all the snapshots of a tree of workflows.
Workflow Experimental Runtime
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION, AnnotationTarget.TYPEALIAS ] )
Content copied to clipboard
This is used to mark any experimental runtimes.
Workflow Interceptor
Link copied to clipboard
interface WorkflowInterceptor
Content copied to clipboard
Provides hooks into the workflow runtime that can be used to instrument or modify the behavior of workflows.
Functions
render Workflow In
Link copied to clipboard
fun <PropsT, OutputT, RenderingT> renderWorkflowIn(workflow: Workflow<PropsT, OutputT, RenderingT>, scope: CoroutineScope, props: StateFlow<PropsT>, initialSnapshot: TreeSnapshot? = null, interceptors: List<WorkflowInterceptor> = emptyList(), runtimeConfig: RuntimeConfig = RuntimeConfig.DEFAULT_CONFIG, onOutput: suspend (OutputT) -> Unit): StateFlow<RenderingAndSnapshot<RenderingT>>
Content copied to clipboard
Launches the workflow in a new coroutine in scope and returns a StateFlow of its renderings and snapshots. The workflow tree is seeded with initialSnapshot and the current value value of props. Subsequent values emitted from props will be used to re-render the workflow.