Skip to content
中文

AsyncSink ​

CORE · type · Type contract

Awaitable sink for an ordered stream. A rejection propagates to the emitter.

Import ​

ts
import type { AsyncSink } from '@jangts/agent-core';
js
/** @typedef {import('@jangts/agent-core').AsyncSink} AsyncSink */

Other public entry points:@jangts/agent-core, @jangts/agent-core/types, @jangts/agent-core/structs.

Definition ​

ts
type AsyncSink<Event> = (event: Readonly<Event>) => Promise<void>;

Type parameters ​

Type parameterConstraintDefault type
Event——

Call ​

ts
AsyncSink(event: Readonly<Event>): Promise<void>
ParameterTypePassingDescription
eventReadonly<Event>Required—

Returns: Promise<void>.

Awaited value: void.

Using the type ​

When using this type, choose type arguments from the table above; parameters with defaults may be omitted.

API reference, usage examples and developer guides.