(options: {
readonly evaluate: LazyArg<Readable | NodeJS.ReadableStream>
readonly onError?: (error: unknown) => E
/**
* Maximum number of Node reads per pull (default 4096). Set to Infinity
* for unbounded batching. Does not control the size of each Node read.
*/
readonly chunkSize?: number | undefined
/**
* Size passed to Node's `read(size)`. Omit to use Node's unsized reads.
*/
readonly readSize?: number | undefined
readonly closeOnDone?: boolean | undefined
})
| 81 | * @since 4.0.0 |
| 82 | */ |
| 83 | export const fromReadableChannel = <A = Uint8Array, E = Cause.UnknownError>(options: { |
| 84 | readonly evaluate: LazyArg<Readable | NodeJS.ReadableStream> |
| 85 | readonly onError?: (error: unknown) => E |
| 86 | /** |
| 87 | * Maximum number of Node reads per pull (default 4096). Set to Infinity |
| 88 | * for unbounded batching. Does not control the size of each Node read. |
| 89 | */ |
| 90 | readonly chunkSize?: number | undefined |
| 91 | /** |
| 92 | * Size passed to Node's `read(size)`. Omit to use Node's unsized reads. |
| 93 | */ |
| 94 | readonly readSize?: number | undefined |
| 95 | readonly closeOnDone?: boolean | undefined |
| 96 | }): Channel.Channel<Arr.NonEmptyReadonlyArray<A>, E> => |
| 97 | Channel.fromTransform((_, scope) => |
| 98 | readableToPullUnsafe({ |
| 99 | scope, |
| 100 | readable: options.evaluate(), |
| 101 | onError: options.onError ?? defaultOnError as any, |
| 102 | chunkSize: options.chunkSize, |
| 103 | readSize: options.readSize, |
| 104 | closeOnDone: options.closeOnDone |
| 105 | }) |
| 106 | ) |
| 107 | |
| 108 | /** |
| 109 | * Creates a `Channel` over a Node `Duplex`, writing upstream chunks with |
no test coverage detected