Interaction with V8
Creating V8 Platform
let snapshot = snapshot::deno_snapshot();
let isolate = isolate::Isolate::new(snapshot, state, ops::dispatch);pub fn new(
snapshot: libdeno::deno_buf,
state: Arc<IsolateState>,
dispatch: Dispatch,
) -> Self {
DENO_INIT.call_once(|| {
unsafe { libdeno::deno_init() };
});
let config = libdeno::deno_config {
will_snapshot: 0,
load_snapshot: snapshot,
shared: libdeno::deno_buf::empty(),
recv_cb: pre_dispatch, // callback to invoke when Rust receives a message
};
let libdeno_isolate = unsafe { libdeno::deno_new(config) };
// This channel handles sending async messages back to the runtime.
let (tx, rx) = mpsc::channel::<(i32, Buf)>();
Self {
libdeno_isolate,
dispatch,
rx,
tx,
ntasks: Cell::new(0),
timeout_due: Cell::new(None),
state,
}
}Adding Bindings
Executing Code on V8
Last updated
Was this helpful?