v8 12.4.254 (node 22.4.1)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
MicrotasksScope Class Reference

#include <v8-microtask-queue.h>

Public Types

enum  Type { kRunMicrotasks , kDoNotRunMicrotasks }
 

Public Member Functions

 V8_DEPRECATE_SOON ("May be incorrect if context was created with non-default microtask " "queue") MicrotasksScope(Isolate *isolate
 
 MicrotasksScope (Local< Context > context, Type type)
 
 MicrotasksScope (Isolate *isolate, MicrotaskQueue *microtask_queue, Type type)
 
 ~MicrotasksScope ()
 
 MicrotasksScope (const MicrotasksScope &)=delete
 
MicrotasksScopeoperator= (const MicrotasksScope &)=delete
 

Static Public Member Functions

static void PerformCheckpoint (Isolate *isolate)
 
static int GetCurrentDepth (Isolate *isolate)
 
static bool IsRunningMicrotasks (Isolate *isolate)
 

Data Fields

Type type
 

Detailed Description

This scope is used to control microtasks when MicrotasksPolicy::kScoped is used on Isolate. In this mode every non-primitive call to V8 should be done inside some MicrotasksScope. Microtasks are executed when topmost MicrotasksScope marked as kRunMicrotasks exits. kDoNotRunMicrotasks should be used to annotate calls not intended to trigger microtasks.

Definition at line 117 of file v8-microtask-queue.h.

Member Enumeration Documentation

◆ Type

enum Type
Enumerator
kRunMicrotasks 
kDoNotRunMicrotasks 

Definition at line 119 of file v8-microtask-queue.h.

Constructor & Destructor Documentation

◆ MicrotasksScope() [1/3]

MicrotasksScope ( Local< Context context,
Type  type 
)

◆ MicrotasksScope() [2/3]

MicrotasksScope ( Isolate isolate,
MicrotaskQueue microtask_queue,
Type  type 
)

◆ ~MicrotasksScope()

◆ MicrotasksScope() [3/3]

MicrotasksScope ( const MicrotasksScope )
delete

Member Function Documentation

◆ GetCurrentDepth()

static int GetCurrentDepth ( Isolate isolate)
static

Returns current depth of nested kRunMicrotasks scopes.

◆ IsRunningMicrotasks()

static bool IsRunningMicrotasks ( Isolate isolate)
static

Returns true while microtasks are being executed.

◆ operator=()

MicrotasksScope & operator= ( const MicrotasksScope )
delete

◆ PerformCheckpoint()

static void PerformCheckpoint ( Isolate isolate)
static

Runs microtasks if no kRunMicrotasks scope is currently active.

◆ V8_DEPRECATE_SOON()

V8_DEPRECATE_SOON ( "May be incorrect if context was created with non-default microtask " "queue"  )

Field Documentation

◆ type

Type type

Definition at line 124 of file v8-microtask-queue.h.


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