ReadableStreamDefaultController

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The ReadableStreamDefaultController interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue. Default controllers are for streams that are not byte streams. 

Constructor

ReadableStreamDefaultController()
Creates and returns a ReadableStreamDefaultController() object instance.

Properties

ReadableStreamDefaultController.desiredSize
Returns the desired size required to fill the stream's internal queue.

Methods

ReadableStreamDefaultController.close()
Closes the associated stream.
ReadableStreamDefaultController.enqueue()
Enqueues a given chunk in the associated stream.
ReadableStreamDefaultController.error()
Causes any future interactions with the associated stream to error.

Examples

TBD.

Specifications

Specification Status Comment
Streams
The definition of 'ReadableStreamDefaultController' in that specification.
Living Standard Initial definition

Browser Compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support

52.0

No support[1] ?

39

?
Feature Android Webview Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 52 52 No support[1] ? 39 ?

[1] Readable streams are currently enabled in Firefox, but hidden behind the dom.streams.enabled and javascript.options.streams prefs.

Document Tags and Contributors

 Contributors to this page: chrisdavidmills
 Last updated by: chrisdavidmills,