fromAsyncIter()
Read an async iterable: each value → DATA; COMPLETE when done; ERROR on failure. async pool.
Optional signal aborts the pump.
Import
Section titled “Import”import { fromAsyncIter } from "@graphrefly/ts/sources";Signature
Section titled “Signature”function fromAsyncIter( iterable: AsyncIterable<T>, opts?: AsyncSourceOpts,): Operator<never, T>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
iterable | AsyncIterable<T> | Async iterable to pump into the graph. |
opts | AsyncSourceOpts | Optional abort signal and async source options. |
Returns
Section titled “Returns”A source operator that emits every iterable value and then COMPLETE.
Example
Section titled “Example”import { graph } from "@graphrefly/ts/graph";import { fromAsyncIter } from "@graphrefly/ts/sources";
const stream = graph().initNode(fromAsyncIter(events()), []);Source
Section titled “Source”packages/ts/src/graph/sources.ts