v8  6.8.275 (node 10.15.3)
V8 is Google's open source JavaScript engine
TaskRunner Class Referenceabstract

#include <v8-platform.h>

Public Member Functions

virtual void PostTask (std::unique_ptr< Task > task)=0
 
virtual void PostDelayedTask (std::unique_ptr< Task > task, double delay_in_seconds)=0
 
virtual void PostIdleTask (std::unique_ptr< IdleTask > task)=0
 
virtual bool IdleTasksEnabled ()=0
 
 TaskRunner ()=default
 
virtual ~TaskRunner ()=default
 

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 48 of file v8-platform.h.

Constructor & Destructor Documentation

◆ TaskRunner()

TaskRunner ( )
default

◆ ~TaskRunner()

virtual ~TaskRunner ( )
virtualdefault

Member Function Documentation

◆ IdleTasksEnabled()

virtual bool IdleTasksEnabled ( )
pure virtual

Returns true if idle tasks are enabled for this TaskRunner.

◆ PostDelayedTask()

virtual void 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 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::SupportsIdleTasks(isolate) 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|.

◆ PostTask()

virtual void 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: