import { type ShutdownAwareTransformer } from "https://deno.land/x/shutdown_aware_transform_stream@1.0.0/mod.ts";
An object that defines the behaviour of a ShutdownAwareTransformStream
.
It behaves in the same way as a normal TransformStream
Transformer,
except that it can have a close()
method, and the Controller received by
its methods is a ShutdownAwareTransformStreamController
.
Properties
Called when the stream is created, before any other Transformer methods.
Called after the final chunk has been processed by transform()
.
Called with each chunk passing through the stream.
Called when the stream has shutdown, either due to an error or end-of-input.
Never called more than once, even if an error occurs as the stream closes
from end-of-input. To distinguish between end-of-input and stream errors,
controller.signal.aborted
will be true when an error occured, and
controller.signal.reason
will be the error.