V8  latest master commit
V8 is Google's open source JavaScript engine
v8::TaskRunner Class Referenceabstract

#include <v8-platform.h>

Public Member Functions

virtual void PostTask (std::unique_ptr< Task > task)=0
 
virtual void PostNonNestableTask (std::unique_ptr< Task > task)
 
virtual void PostDelayedTask (std::unique_ptr< Task > task, double delay_in_seconds)=0
 
virtual void PostNonNestableDelayedTask (std::unique_ptr< Task > task, double delay_in_seconds)
 
virtual void PostIdleTask (std::unique_ptr< IdleTask > task)=0
 
virtual bool IdleTasksEnabled ()=0
 
virtual bool NonNestableTasksEnabled () const
 
virtual bool NonNestableDelayedTasksEnabled () const
 
 TaskRunner ()=default
 
virtual ~TaskRunner ()=default
 
 TaskRunner (const TaskRunner &)=delete
 
TaskRunneroperator= (const TaskRunner &)=delete
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TaskRunner() [1/2]

v8::TaskRunner::TaskRunner ( )
default

◆ ~TaskRunner()

virtual v8::TaskRunner::~TaskRunner ( )
virtualdefault

◆ TaskRunner() [2/2]

v8::TaskRunner::TaskRunner ( const TaskRunner )
delete

Member Function Documentation

◆ IdleTasksEnabled()

virtual bool v8::TaskRunner::IdleTasksEnabled ( )
pure virtual

Returns true if idle tasks are enabled for this TaskRunner.

◆ NonNestableDelayedTasksEnabled()

virtual bool v8::TaskRunner::NonNestableDelayedTasksEnabled ( ) const
inlinevirtual

Returns true if non-nestable delayed tasks are enabled for this TaskRunner.

Definition at line 129 of file v8-platform.h.

◆ NonNestableTasksEnabled()

virtual bool v8::TaskRunner::NonNestableTasksEnabled ( ) const
inlinevirtual

Returns true if non-nestable tasks are enabled for this TaskRunner.

Definition at line 124 of file v8-platform.h.

◆ operator=()

TaskRunner& v8::TaskRunner::operator= ( const TaskRunner )
delete

◆ PostDelayedTask()

virtual void v8::TaskRunner::PostDelayedTask ( std::unique_ptr< Task task,
double  delay_in_seconds 
)
pure virtual

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

◆ PostIdleTask()

virtual void v8::TaskRunner::PostIdleTask ( std::unique_ptr< IdleTask task)
pure virtual

Schedules an idle task to be invoked by this TaskRunner. The task is scheduled when the embedder is idle. Requires that |TaskRunner::IdleTasksEnabled()| is true. Idle tasks may be reordered relative to other task types and may be starved for an arbitrarily long time if no idle time is available. The TaskRunner implementation takes ownership of |task|.

◆ PostNonNestableDelayedTask()

virtual void v8::TaskRunner::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.

Requires that |TaskRunner::NonNestableDelayedTasksEnabled()| is true.

Definition at line 103 of file v8-platform.h.

◆ PostNonNestableTask()

virtual void v8::TaskRunner::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.

Requires that |TaskRunner::NonNestableTasksEnabled()| is true.

Definition at line 85 of file v8-platform.h.

◆ PostTask()

virtual void v8::TaskRunner::PostTask ( std::unique_ptr< Task task)
pure virtual

Schedules a task to be invoked by this TaskRunner. The TaskRunner implementation takes ownership of |task|.


The documentation for this class was generated from the following file: