When a Streamrooter::fetch
call is invoked with streaming: true
option on.
Supported requests and environments:
- Browsers with usable
ReadableStream
infetch
. The browsers and versions that support this feature can be found here. - Only applicable on calls whose:
ResponseType
isStreamrooter.ResponseTypes.ARRAY_BUFFER
.- Is executed fully on CDN, which means:
- Pre-P2P-cached responses will be done immediately with the cached data and thus no need for streaming.
- Partially-P2P-cached responses is not supported for the moment and will be added in a later update.
Note
It is not guaranteed to be executed in
It is not guaranteed to be executed in
streaming
mode even on supported requests as the feature can be disabled on Lumen's side without any prior notice.Those requests will have a modified onProgress
callback with this signature instead:
onProgress: Function (config: FetchConfig, progress: FetchProgress. data:
ArrayBuffer)
- config: The fetch config used for this request.
- progress: An object describing the operational statistics of the whole request.
- data (optional):
ArrayBuffer
containing received data since the lastonProgress
call orundefined
if the request is not streamed.
The other onSuccess
and onError
callbacks work the same as in normal non-streaming mode.