Table of Contents

Class ReadableStreamDefaultController

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

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.

[Value("ReadableStreamDefaultController")]
public class ReadableStreamDefaultController
Inheritance
ReadableStreamDefaultController
Inherited Members

Remarks

Constructors

ReadableStreamDefaultController()

public ReadableStreamDefaultController()

Properties

DesiredSize

The desiredSize read-only property of the
ReadableStreamDefaultController interface returns the desired size
required to fill the stream's internal queue.

[Value("desiredSize")]
public double? DesiredSize { get; }

Property Value

double?

An integer. Note that this can be negative if the queue is over-full.

Remarks

Methods

Close()

The close() method of the ReadableStreamDefaultController interface closes the associated stream.

[Value("close")]
public GlobalObject.Undefined Close()

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. If you want to completely get rid of the stream and discard any enqueued chunks, you'd use Cancel(dynamic) or ReadableStreamDefaultReader.Cancel.

-Using readable streams
-ReadableStreamDefaultController

See also on MDN

Enqueue(dynamic)

The enqueue() method of the
ReadableStreamDefaultController interface enqueues a given chunk in the associated stream.

[Value("enqueue")]
public GlobalObject.Undefined Enqueue(dynamic chunk = null)

Parameters

chunk dynamic

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

Error(dynamic)

The error() method of the
ReadableStreamDefaultController interface causes any future interactions
with the associated stream to error.

[Value("error")]
public GlobalObject.Undefined Error(dynamic e = null)

Parameters

e dynamic

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

NOTE

The error() method can be called
more than once, and can be called when the stream is not readable.

-Using readable streams
-ReadableStreamDefaultController

See also on MDN