Class: CancellableEventEmitter

CancellableEventEmitter(request)

A cancellable event emitter at which the progress of a request can be monitored and at which the request can be cancelled. See the NodeJS EventEmitter documentation for more information.

Constructor

new CancellableEventEmitter(request)

Creates an instance.

Parameters:
Name Type Description
request object

An object that should expose an 'cancel()' method that accepts an optional reason (string).

Source:

Extends

  • EventEmitter

Methods

cancel(reason)

Cancel the request. If a reason is provided, it will cause the RequestCallback provided to the fetch() method to be called with a RequestError as it single argument, containing status 512 and this reason as its message.

Parameters:
Name Type Description
reason string

The reason for the cancellation. If omitted, the request will be cancelled or aborted silently.

Source: