Class webdriver.promise.Task_

code »
webdriver.promise.Promise.<(T|null)>
  └ webdriver.promise.Deferredwebdriver.promise.Node_
          └ webdriver.promise.Task_
All implemented interfaces:
webdriver.promise.Thenable.<(T|null)>

A task to be executed by a webdriver.promise.ControlFlow.

Constructor

webdriver.promise.Task_ ( flow, fn, description, snapshot )
Parameters
flow: !webdriver.promise.ControlFlow
The flow this instances belongs to.
fn: !Function
The function to call when the task executes. If it returns a webdriver.promise.Promise, the flow will wait for it to be resolved before starting the next task.
description: string
A description of the task for debugging.
snapshot: !webdriver.stacktrace.Snapshot
A snapshot of the stack when this task was scheduled.
Show:

Instance Methods

Defined in webdriver.promise.Task_

Executes this task.

Returns
This task's description.
code »toString ( )string

Defined in webdriver.promise.Node_

Returns
This node's parent.
Returns
The root of this node's tree.
code »setParent ( parent )
Parameters
parent: webdriver.promise.Node_
This node's new parent.

Defined in webdriver.promise.Deferred

code »errback ( opt_error )

Rejects this promise. If the error is itself a promise, this instance will be chained to it and be rejected with the error's resolved value.

Parameters
opt_error: *=
The rejection reason, typically either a Error or a string.
code »fulfill ( opt_value )

Resolves this promise with the given value. If the value is itself a promise and not a reference to this deferred, this instance will wait for it before resolving.

Parameters
opt_value: T=
The fulfilled value.
code »reject ( opt_error )

Rejects this promise. If the error is itself a promise, this instance will be chained to it and be rejected with the error's resolved value.

Parameters
opt_error: *=
The rejection reason, typically either a Error or a string.

Removes all of the listeners previously registered on this deferred.

Throws
Error
If this deferred has already been resolved.

Defined in webdriver.promise.Promise.<(T|null)>

code »cancel ( reason )
Parameters
reason
code »isPending ( )boolean
code »then ( opt_callback, opt_errback )
Parameters
opt_callback
opt_errback
code »thenCatch ( errback )
Parameters
errback
code »thenFinally ( callback )
Parameters
callback

Instance Properties

Defined in webdriver.promise.Task_

Defined in webdriver.promise.Node_

Defined in webdriver.promise.Deferred

Represents the eventual value of a completed operation. Each promise may be in one of three states: pending, resolved, or rejected. Each promise starts in the pending state and may make a single transition to either a fulfilled or rejected state, at which point the promise is considered resolved.

Static Properties