AsyncChannel
Defined in: packages/core/src/async-channel.ts:9
A small push→pull bridge: a producer calls push/close/fail; a consumer iterates with
for await. Useful for exposing an event-emitter-based source (a spawned process’s
stdout/stderr, a websocket, …) as an AsyncIterable — in particular, the shape the AI
SDK’s tool execute accepts for a tool that streams preliminary results before its final one
(see AgentToolResultEvent’s doc comment in ./observability/events for what that produces
on the ADL event stream).
Type Parameters
Section titled “Type Parameters”T
Methods
Section titled “Methods”[asyncIterator]()
Section titled “[asyncIterator]()”[asyncIterator]():
AsyncGenerator<T,void,unknown>
Defined in: packages/core/src/async-channel.ts:13
Returns
Section titled “Returns”AsyncGenerator<T, void, unknown>
close()
Section titled “close()”close():
void
Defined in: packages/core/src/async-channel.ts:11
Returns
Section titled “Returns”void
fail()
Section titled “fail()”fail(
error):void
Defined in: packages/core/src/async-channel.ts:12
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”void
push()
Section titled “push()”push(
value):void
Defined in: packages/core/src/async-channel.ts:10
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”void