type
TypedTask
Compiled typed durable-task definition.
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.
Full signature
type TypedTask[Input, Output any] struct {
// contains filtered or unexported fields
}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.