The underlying source of a ReadableStream that can have chunks queued to from an external source.
Queuing items externally.
const controller = new ControllableSource<number>()const stream = new ReadableStream(controller)controller.enqueue(1)controller.enqueue(2)controller.enqueue(3)controller.close() Copy
const controller = new ControllableSource<number>()const stream = new ReadableStream(controller)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)
Private
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.
Generated using TypeDoc
The underlying source of a ReadableStream that can have chunks queued to from an external source.
Example
Queuing items externally.
Registering pull subscribers externally.