A representation of an abortable operation. Note that these are not
cancelable. Cancelation implies undoing what has been done so far,
whereas aborting only means that futher work is stopped.
- Implementations:
- Source:
Members
(export, constant, non-null) promise :Promise.<T>
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.
Type:
- Promise.<T>
- Source:
Methods
(export) abort() → (non-null) {Promise}
Can be called by anyone holding 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.
- Source:
Returns:
- Type
- Promise
(export) finally(onFinal) → (non-null) {shaka.extern.IAbortableOperation.<T>}
Parameters:
Name | Type | Description |
---|---|---|
onFinal |
function(boolean) | A callback to be invoked after the operation succeeds or fails. The boolean argument is true if the operation succeeded and false if it failed. |
- Source:
Returns:
Returns this.
- Type
- shaka.extern.IAbortableOperation.<T>