Class: shaka.net.NetworkingEngine.PendingRequest

Constructor

new PendingRequest(promisenon-null, onAbort, numBytesRemainingObj)

Parameters:
Name Type Description
promise Promise A Promise which represents the underlying operation. It is resolved when the operation is complete, and rejected if the operation fails or is aborted. Aborted operations should be rejected with a shaka.util.Error object using the error code OPERATION_ABORTED.
onAbort function Will be called by this object to abort the underlying operation. This is not cancelation, and will not necessarily result in any work being undone. abort() should return a Promise which is resolved when the underlying operation has been aborted. The returned Promise should never be rejected.
numBytesRemainingObj shaka.net.NetworkingEngine.NumBytesRemainingClass
Implements:
Extends:
Source:

Extends

Members

abortPromise_ :Promise

Type:
  • Promise
Overrides:
Source:

onAbort_ :function

Type:
  • function
Overrides:
Source:

promise :Promise.<T>

Type:
  • Promise.<T>
Overrides:
Source:

Methods

chain(onSuccess, onErroropt) → {shaka.util.AbortableOperation.<U>}

Parameters:
Name Type Attributes Description
onSuccess undefined | function | function | function A callback to be invoked after this operation is complete, to chain to another operation. The callback can return a plain value, a Promise to an asynchronous value, or another AbortableOperation.
onError function <optional>
An optional callback to be invoked if this operation fails, to perform some cleanup or error handling. Analogous to the second parameter of Promise.prototype.then.
Overrides:
Source:
Returns:
An operation which is resolved when this operation and the operation started by the callback are both complete.
Type
shaka.util.AbortableOperation.<U>

getBytesRemaining() → {number}

Source:
Returns:
Type
number