Class: RangeStream
Defined in: stream.ts:62
One streamed HTTP request for one merged byte range, serving the reads (members) inside it. Each member resolves the moment its last byte has arrived, with a view into the stream's buffer; a member can attach while the stream is in flight. A suffix or whole-object request serves exactly one member, resolved when the body ends.
Constructors
Constructor
new RangeStream(
file,request,members,options):RangeStream
Defined in: stream.ts:93
Parameters
file
request
ReadRange | undefined
members
options
Returns
RangeStream
Properties
file
readonlyfile:FileIdentity
Defined in: stream.ts:63
range
readonlyrange:ByteRange|undefined
Defined in: stream.ts:65
The absolute range requested; undefined for suffix and whole-object requests.
Accessors
active
Get Signature
get active():
boolean
Defined in: stream.ts:121
True from construction until the outcome settles.
Returns
boolean
received
Get Signature
get received():
number
Defined in: stream.ts:116
Bytes received so far.
Returns
number
Methods
attach()
attach(
member):boolean
Defined in: stream.ts:132
Add a read inside this stream's absolute range. A read whose bytes have already arrived resolves at once, even once the stream is done (see #826); any other read joins only while it is active. Returns false when the stream has no absolute range, does not cover the read, or is done without its bytes.
Parameters
member
Returns
boolean
run()
run():
Promise<StreamOutcome>
Defined in: stream.ts:161
Take the limiter slot, send the request and read its body. Never rejects: every way the request can end is an outcome.