# Class webdriver.promise.Task_.`<T>`

code »

    webdriver.promise.Promise.<(T|null)>
      └ webdriver.promise.Deferred.<(T|null)>
          └ 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(): (T|!webdriver.promise.Promise.<T>)` 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:Public Protected Private

## Instance Methods

### Defined in `webdriver.promise.Task_`

code »execute ( ) ⇒ `(T|webdriver.promise.Promise.)`
code »getDescription ( ) ⇒ `string`

Returns
This task's description.

code »toString ( ) ⇒ `string`

### Defined in `webdriver.promise.Deferred.<(T|null)>`

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`.

code »removeAll ( )

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_`

code »description_ : `string`
code »snapshot_ : `!webdriver.stacktrace.Snapshot`

### Defined in `webdriver.promise.Deferred.<(T|null)>`

code »parent_ : `webdriver.promise.Deferred`

The deferred this instance is chained from, if any.

code »webdriver.promise.Deferred.<(T|null)>.prototype.promise : `webdriver.promise.Promise.`

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

code »webdriver.promise.Task_.superClass_ : `webdriver.promise.Deferred.prototype`