type

TaskHandler

Compiled typed durable-task handler.

Arguments

ArgumentTypeDescription
contextTaskContextThe leased attempt, cancellation context, identity, and LocalAPI.
inputInputStrictly decoded task input for this definition.

Returns

Typed output, or a retryable/terminal error.

(Output, error)

How it works

Handlers must honor cancellation and make external side effects idempotent because a process crash or lease expiry can cause another attempt.

Full signature

type TaskHandler[Input, Output any] func( TaskContext, Input, ) (Output, error)

Source core/task.go:49

Related types

  • TaskContext

    Request-scoped view of one leased durable-task attempt.