Class: Request

Request

new Request(opts)

Construct a new Request.
Parameters:
Name Type Description
opts Object Options for this request.
Properties
Name Type Attributes Description
id string <optional>
Optional ID to set on this request. One will be generated if this is not provided.
data * <optional>
Optional data to associate with this request.
Source:

Methods

getData() → {*}

Get any optional data set on this request.
Source:
Returns:
The data
Type
*

getDuration() → {number}

Get the number of elapsed milliseconds since this request was created.
Source:
Returns:
The number of milliseconds since this request was made.
Type
number

getId() → {String}

Get this request's ID.
Source:
Returns:
The ID.
Type
String

getPromise() → {Promise}

Retrieve a promise for this request which will be resolved/rejected when the respective methods are called on this Request.
Source:
Returns:
A promise
Type
Promise

outcomeFrom(The)

Resolve or reject the promise depending on the outcome of this promise.
Parameters:
Name Type Description
The Promise promise whose resolution determines the outcome of this request.
Source:

reject(msg)

Reject a request. This should be invoked for requests which failed to be processed correctly.
Parameters:
Name Type Description
msg * The thing to reject with.
Source:

resolve(msg)

Resolve a request. This should be invoked for the successful processing of this request. This doesn't necessarily mean that the request was sent through, e.g. suppressing AS virtual users' messages is still a success.
Parameters:
Name Type Description
msg * The thing to resolve with.
Source: