API reference

A small surface for explicit ownership.

The core API is organized by lifetime rather than by adapter. Each operation states what owns the work and when it must stop.

Tasks

context.fork(name, operation)

Create a named child task owned by the current handler scope.

context.delivery.fork(name, operation)

Create work that remains owned while the response body is delivered.

Cancellation

context.signal

Cooperative AbortSignal shared with handler-owned work.

context.delivery.signal

Signal tied to the delivery lifetime.

signal.reason

The first typed abort reason retained for diagnostics.

Resources

context.use(name, acquire, cleanup)

Acquire a handler-scoped resource and release it exactly once.

context.delivery.use(name, acquire, cleanup)

Keep a resource alive until delivery closes.