iexec / <internal> / TaskObservable
new TaskObservable():
TaskObservable
TaskObservable
subscribe(
callbacks): () =>void
subscribe to task updates via an Observer until either complete() or error(error: Error) is called on the Observer or the subscription is canceled by calling the returned unsubscribe method.
return the unsubscribe: () => void method.
data:
| message | comment |
|---|---|
TASK_UPDATED |
sent with every time the task status changes |
TASK_COMPLETED |
sent once when the task is completed |
TASK_TIMEDOUT |
sent once when the deadline is reached before completion |
TASK_FAILED |
sent once when the task is claimed after a timeout |
() => any
callback fired once when the task is completed or when the deadline is reached
no other callback is fired after firing complete()
(error) => any
callback fired once when an error occurs
no other callback is fired after firing error(error: Error)
(data) => any
callback fired with initial task status and after every task status update
data:
| message | comment |
|---|---|
TASK_UPDATED |
sent with every time the task status changes |
TASK_COMPLETED |
sent once when the task is completed |
TASK_TIMEDOUT |
sent once when the deadline is reached before completion |
TASK_FAILED |
sent once when the task is claimed after a timeout |
():
void
void