Class TransformStreamDefaultController
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The TransformStreamDefaultController interface of the Streams API provides methods to manipulate the associated ReadableStream and WritableStream.
[Value("TransformStreamDefaultController")]
public class TransformStreamDefaultController
- Inheritance
-
TransformStreamDefaultController
- Inherited Members
Remarks
When constructing a TransformStream, the TransformStreamDefaultController is created. It therefore has no constructor. The way to get an instance of TransformStreamDefaultController is via the callback methods of TransformStream(Object, QueuingStrategy, QueuingStrategy).
Constructors
TransformStreamDefaultController()
public TransformStreamDefaultController()
Properties
DesiredSize
The desiredSize read-only property of the TransformStreamDefaultController interface returns the desired size to fill the queue of the associated ReadableStream.
[Value("desiredSize")]
public double? DesiredSize { get; }
Property Value
- double?
The desired size.
Remarks
The internal queue of a ReadableStream contains chunks that have been enqueued, but not yet read. The browser determines the desired size to fill the stream, and it is this value returned by the desiredSize property.
If the desiredSize is 0 then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue.
Methods
Enqueue(dynamic)
The enqueue() method of the TransformStreamDefaultController interface enqueues the given chunk in the readable side of the stream.
[Value("enqueue")]
public GlobalObject.Undefined Enqueue(dynamic chunk = null)
Parameters
chunkdynamic
Returns
Remarks
For more information on readable streams and chunks see Using Readable Streams.
Error(dynamic)
The error() method of the TransformStreamDefaultController interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded.
[Value("error")]
public GlobalObject.Undefined Error(dynamic reason = null)
Parameters
reasondynamic
Returns
Remarks
Terminate()
The terminate() method of the TransformStreamDefaultController interface closes the readable side and errors the writable side of the stream.
[Value("terminate")]
public GlobalObject.Undefined Terminate()