Module v8::isolate [] [src]

Heap and execution isolation.

Usage

Construct a new isolate with default settings by doing Isolate::new(). You can customize the isolate settings by using Isolate::builder().

Foreground tasks

Javascript can produce "deferred" or "time-outed" tasks that need to run on the main thread. Additionally, V8 has a bunch of internal tasks it wants to perform regularly (for example GC). The user should therefore call isolate.run_enqueued_tasks() regularly to allow these tasks to run.

Background tasks

Javascript and V8 can trigger various background tasks to run. These will be run as simple background OS threads, while trying to keep the number of running background tasks less than the number of available CPUs.

Idle tasks

V8 can perform various maintenance tasks if the application has nothing better to do. If the user wants to allow this to happen, an isolate should be constructed with Isolate::builder().supports_idle_tasks(true).build(). The user should then regularly call isolate.run_idle_tasks(deadline) to run any pending idle tasks.

Structs

Builder

A builder for isolates. Can be converted into an isolate with the build method.

Isolate

Isolate represents an isolated instance of the V8 engine.