Skip to content

Documentation / @ember-data/request / Future

Interface: Future<T>

Defined in: warp-drive-packages/core/declarations/request/-private/types.d.ts:36

A Future is a Promise which resolves or rejects with a StructuredDocument while providing the ability to abort the underlying request, and access the response stream before the outer promise resolves;

Extends

Type Parameters

T

T

Methods

abort()

ts
abort(reason?): void;

Defined in: warp-drive-packages/core/declarations/request/-private/types.d.ts:49

Cancel this request by firing the AbortController's signal.

This method can be used as an action or event handler as its context is bound to the Future instance.

Parameters

reason?

string

optional reason for aborting the request

Returns

void


getStream()

ts
getStream(): Promise<
  | null
| ReadableStream<any>>;

Defined in: warp-drive-packages/core/declarations/request/-private/types.d.ts:58

Get the response stream, if any, once made available.

This method can be used as an action or event handler as its context is bound to the Future instance.

Returns

Promise< | null | ReadableStream<any>>


onFinalize()

ts
onFinalize(cb): void;

Defined in: warp-drive-packages/core/declarations/request/-private/types.d.ts:65

Run a callback when this request completes. Use sparingly, mostly useful for instrumentation and infrastructure.

Parameters

cb

() => void

the callback to run

Returns

void

Properties

id

ts
id: number;

Defined in: warp-drive-packages/core/declarations/request/-private/types.d.ts:78

The id of the associated request, if any, as assigned by the RequestManager

This is not unique across Manager instances and cannot be used to identify or dedupe requests.


lid

ts
lid: 
  | null
  | RequestKey;

Defined in: warp-drive-packages/core/declarations/request/-private/types.d.ts:70

The identifier of the associated request, if any, as assigned by the CacheHandler.

Released under the MIT License.