Skip to content

@oona/vlo / index / ActivityHandler

Type Alias: ActivityHandler<I, O> ​

ActivityHandler<I, O> = (input, ctx) => O | Promise<O>

Defined in: sdk/ts/sdk/src/host/worker/registry.ts:45

The implementation of one activity. input has already passed the activity's input schema; the return value is validated against its output schema by the host. A throw fails the attempt as retryable; aborting on ctx.signal is how a handler cooperates with a timeout, a lost lease or a shutdown.

Type Parameters ​

I ​

I = Json

O ​

O = unknown

Parameters ​

input ​

I

ctx ​

TaskContext

Returns ​

O | Promise<O>