Interface IScyllaPausableState<TContext>
Optional extension of IScyllaState<TContext> for states that want to be notified when a ScyllaPushdownStateMachine<TContext> pushes another state over them (OnPause(TContext)) and when they become current again after a pop (OnResume(TContext)).
Inherited Members
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public interface IScyllaPausableState<in TContext> : IScyllaState<TContext>
Type Parameters
| Name | Description |
|---|---|
| TContext | The shared context type passed to every state callback. |
Remarks
Pushdown semantics deliberately do NOT run OnExit(TContext) when a state is pushed over, nor OnEnter(TContext) when it resumes: the state never left the machine, it was only suspended. States that do not implement this interface simply receive no callback on push and pop; their state is preserved untouched either way.
Pause and resume callbacks run inside the machine's guarded callback section, so initiating transitions from them throws, exactly as in enter and exit callbacks.
Methods
OnPause(TContext)
Called when another state is pushed over this state. The state remains on the machine's stack and keeps its data; it stops receiving ticks until resumed.
Declaration
void OnPause(TContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | context | The machine's shared context. |
OnResume(TContext)
Called when this state becomes current again after the state above it was popped. OnEnter(TContext) is NOT called; the state resumes exactly where it was paused.
Declaration
void OnResume(TContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | context | The machine's shared context. |