Namespace: webdriver.promise
View Source

# class Task_<T>

    webdriver.promise.Deferred<T>
      └ webdriver.promise.Task_

All implemented interfaces:
  `webdriver.promise.Thenable<T>`

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

## new Task_(flow, fn, description)

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.

## Instance Methods

### execute()code »

Returns

`(T|webdriver.promise.Promise<T>)`

### getDescription()code »

Returns

`string`

  This task's description.

### getFrame()code »

Returns

`webdriver.promise.Frame_`

  frame The frame used to run this task's `#execute` method.

### setFrame(frame)code »

Parameters

frame`webdriver.promise.Frame_`

  The frame used to run this task's `#execute` method.

### setParent(frame)code »

Parameters

frame`webdriver.promise.Frame_`

  The frame this task is scheduled in.

### toString()code »

Returns

`string`