type
TypedTask
A registered typed handle for durable admission, status, and cancellation.
Properties
| Property | Type | Description |
|---|---|---|
TaskSlug | func() string | Returns the stable registered task slug. |
Enqueue | func(context.Context, | Validates and durably admits typed input. |
Result | func(context.Context, | Loads and decodes typed task status and output. |
Cancel | func(context.Context, | Prevents queued work and fences a running attempt. |
How it works
Only NewTask constructs a valid definition. Add it to Config.Tasks before using its runtime methods.
The handle slug/type contract must match the definition registered in the running application. HasOutput distinguishes a valid zero/null output from incomplete work.
Full signature
type TypedTask[Input, Output any] = core.TypedTask[Input, Output]Methods
TypedTask.Cancel()Cancel atomically prevents a queued task from starting and fences a running attempt so its later heartbeat/completion cannot win.
TypedTask.Enqueue()Enqueue validates and durably stores typed input. The task must be the same slug/type contract registered in the running application's Config.Tasks.
TypedTask.Result()Result loads and decodes one task created by this typed definition.
TypedTask.TaskSlug()Public method TypedTask.TaskSlug from github.com/riducms/ridu/core.