function

NewTask

Define one compiled typed durable task.

Arguments

ArgumentTypeDescription
slugstringStable lowercase kebab-case task identity.
handlerTaskHandler[Input, Output]Compiled idempotent handler.
options[]TaskOptionQueue, retries, timeout, retention, and optional admission recovery.

Returns

A definition to register in Config.Tasks and use for typed runtime operations.

TypedTask[Input, Output]

Full signature

func NewTask[Input, Output any]( slug string, handler TaskHandler[Input, Output], options ...TaskOption, ) TypedTask[Input, Output]

Source core/task.go:144

Related types