A TaskRunner allows scheduling of tasks. The TaskRunner may still be used to post tasks after the isolate gets destructed, but these tasks may not get executed anymore. All tasks posted to a given TaskRunner will be invoked in sequence. Tasks can be posted from any thread.
Definition at line 70 of file v8-platform.h.
| virtual void PostNonNestableDelayedTask |
( |
std::unique_ptr< Task > |
task, |
|
|
double |
delay_in_seconds |
|
) |
| |
|
inlinevirtual |
Schedules a task to be invoked by this TaskRunner. The task is scheduled after the given number of seconds |delay_in_seconds|. The TaskRunner implementation takes ownership of |task|. The |task| cannot be nested within other task executions.
Tasks which shouldn't be interleaved with JS execution must be posted with |PostNonNestableTask| or |PostNonNestableDelayedTask|. This is because the embedder may process tasks in a callback which is called during JS execution.
In particular, tasks which execute JS must be non-nestable, since JS execution is not allowed to nest.
Requires that |TaskRunner::NonNestableDelayedTasksEnabled()| is true.
Definition at line 119 of file v8-platform.h.
| virtual void PostNonNestableTask |
( |
std::unique_ptr< Task > |
task | ) |
|
|
inlinevirtual |
Schedules a task to be invoked by this TaskRunner. The TaskRunner implementation takes ownership of |task|. The |task| cannot be nested within other task executions.
Tasks which shouldn't be interleaved with JS execution must be posted with |PostNonNestableTask| or |PostNonNestableDelayedTask|. This is because the embedder may process tasks in a callback which is called during JS execution.
In particular, tasks which execute JS must be non-nestable, since JS execution is not allowed to nest.
Requires that |TaskRunner::NonNestableTasksEnabled()| is true.
Definition at line 93 of file v8-platform.h.