public enum V8MicrotasksPolicy extends java.lang.Enum<V8MicrotasksPolicy>
The ids are aligned with v8::MicrotasksPolicy.
| Enum Constant and Description |
|---|
Auto
Microtasks are invoked when the JavaScript call depth decrements to zero.
|
Explicit
Microtasks are only invoked by an explicit microtask checkpoint.
|
Scoped
Microtasks invocation is controlled by
v8::MicrotasksScope objects. |
| Modifier and Type | Method and Description |
|---|---|
int |
getId()
Gets id.
|
java.lang.String |
getName()
Gets name.
|
static V8MicrotasksPolicy |
parse(int id)
Parse microtasks policy from id.
|
static V8MicrotasksPolicy |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static V8MicrotasksPolicy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final V8MicrotasksPolicy Explicit
Nothing drains the microtask queue automatically, so the promise jobs stay pending until the checkpoint is performed. It allows a batch of calls to be made against the V8 runtime before the pending promise jobs are drained in one go.
public static final V8MicrotasksPolicy Scoped
v8::MicrotasksScope objects.
Javet never creates a v8::MicrotasksScope, hence this policy is not supported.
It is defined here only so that the policy reported by V8 can always be represented.
public static final V8MicrotasksPolicy Auto
It is the default policy in the V8 mode. Every call made against the V8 runtime is a call depth boundary of its own, so the microtask queue is drained as soon as that call returns.
public static V8MicrotasksPolicy[] values()
for (V8MicrotasksPolicy c : V8MicrotasksPolicy.values()) System.out.println(c);
public static V8MicrotasksPolicy valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic static V8MicrotasksPolicy parse(int id)
id - the idpublic int getId()
public java.lang.String getName()