Header menu logo Nao

SessionTaskGrain Type

 Grain that owns and runs a single async task. Key = "userId/sessionId/taskId".

 Lifecycle:
 1. `StartAsync` persists the spec, marks the task running, and fire-and-forget
    dispatches `RunAsync` on this same grain (so the caller is never blocked).
 2. `RunAsync` resolves an `ITaskExecutor` by kind and runs the work, pushing progress
    and the terminal status back to the parent session grain.
 3. On activation, an interrupted (`running`/`pending`) task is re-dispatched to resume.

 The work is kept behind a serializable params bag (`ParamsJson`) rather than an
 in-process closure, which is what makes resume-after-restart possible.

Constructors

Constructor Description

SessionTaskGrain(state, executors, taskStore, grainFactory)

Full Usage: SessionTaskGrain(state, executors, taskStore, grainFactory)

Parameters:
Returns: SessionTaskGrain
state : IPersistentState<SessionTaskState>
executors : IEnumerable<ITaskExecutor>
taskStore : ITaskStore
grainFactory : IGrainFactory
Returns: SessionTaskGrain

Type something to start searching.