Browse documentation

TaskHandler

Type. Synchronous or asynchronous Task operation.

Table of contents

Category

Type

Type import

ts
import type { TaskHandler } from "valyrian.js/tasks";

Public signature

ts
type TaskHandler<TArgs, TResult> = (args: TArgs, ctx: TaskContext) => Promise<TResult> | TResult;

Type usage

TaskHandler may return its generic result synchronously or through a promise.