Skip to content

//workflow/com.squareup.workflow1/StatefulWorkflow/snapshotState

snapshotState

[jvm]
Content
abstract fun snapshotState(state: StateT): Snapshot?
More info

Called whenever the state changes to generate a new Snapshot of the state.

Snapshots must be lazy.

Serialization must not be done at the time this method is called, since the state will be snapshotted frequently but the serialized form may only be needed very rarely.

If the workflow does not have any state, or should always be started from scratch, return null from this method.

See also

jvm

com.squareup.workflow1.StatefulWorkflow