A ControllableStream is ReadableStream that can have chunks queued to from an external source.
Queuing items externally.
const controller = new ControllableStream<number>()controller.enqueue(1)controller.enqueue(2)controller.enqueue(3)controller.close() Copy
const controller = new ControllableStream<number>()controller.enqueue(1)controller.enqueue(2)controller.enqueue(3)controller.close()
Registering pull subscribers externally.
const controller = new ControllableStream<number>()let i = -1controller.onPull(() => ++i) Copy
const controller = new ControllableStream<number>()let i = -1controller.onPull(() => ++i)
Readonly
Optional
Register a pull subscriber.
When the stream is ready to pull it will pull from all subscribers until the desired size has been fulfilled.
A ControllableStream is ReadableStream that can have chunks queued to from an external source.
Example
Queuing items externally.
Registering pull subscribers externally.