From 51dc46eff4a122543f4a290c00fa29e3b272f70f Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 3 Oct 2018 20:51:20 -0400 Subject: [PATCH] Rename msg_from_js() to dispatch(). --- src/main.rs | 2 +- src/ops.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 274206c180..bec97ea605 100644 --- a/src/main.rs +++ b/src/main.rs @@ -56,7 +56,7 @@ impl log::Log for Logger { fn main() { log::set_logger(&LOGGER).unwrap(); let args = env::args().collect(); - let mut isolate = isolate::Isolate::new(args, ops::msg_from_js); + let mut isolate = isolate::Isolate::new(args, ops::dispatch); flags::process(&isolate.state.flags); tokio_util::init(|| { isolate diff --git a/src/ops.rs b/src/ops.rs index 7ef34cb572..baa8a2a0b2 100644 --- a/src/ops.rs +++ b/src/ops.rs @@ -50,7 +50,11 @@ fn empty_buf() -> Buf { Box::new([]) } -pub fn msg_from_js( +/// Processes raw messages from JavaScript. +/// This functions invoked every time libdeno.send() is called. +/// control corresponds to the first argument of libdeno.send(). +/// data corresponds to the second argument of libdeno.send(). +pub fn dispatch( isolate: &mut Isolate, control: &[u8], data: &'static mut [u8],