Skip to content
Permalink
Browse files

rename Behavior::recv to Behavior::dispatch

  • Loading branch information...
ry committed Mar 14, 2019
1 parent 04c14d5 commit 64a16bf41fab3e0f27c7c94cc75ace7df29a6d8a
Showing with 13 additions and 5 deletions.
  1. +1 −1 core/http_bench.rs
  2. +7 −3 core/isolate.rs
  3. +5 −1 src/cli.rs
@@ -80,7 +80,7 @@ impl Behavior<Record> for HttpBench {
unimplemented!()
}

fn recv(
fn dispatch(
&mut self,
record: Record,
zero_copy_buf: deno_buf,
@@ -45,7 +45,11 @@ pub trait Behavior<R> {

fn resolve(&mut self, specifier: &str, referrer: deno_mod) -> deno_mod;

fn recv(&mut self, record: R, zero_copy_buf: deno_buf) -> (bool, Box<Op<R>>);
fn dispatch(
&mut self,
record: R,
zero_copy_buf: deno_buf,
) -> (bool, Box<Op<R>>);

/// Clears the shared buffer.
fn records_reset(&mut self);
@@ -115,7 +119,7 @@ impl<R, B: Behavior<R>> Isolate<R, B> {

isolate.behavior.records_reset();

let (is_sync, op) = isolate.behavior.recv(req_record, zero_copy_buf);
let (is_sync, op) = isolate.behavior.dispatch(req_record, zero_copy_buf);
if is_sync {
let res_record = op.wait().unwrap();
let push_success = isolate.behavior.records_push(res_record);
@@ -409,7 +413,7 @@ mod tests {
None
}

fn recv(
fn dispatch(
&mut self,
_record: (),
_zero_copy_buf: deno_buf,
@@ -112,7 +112,11 @@ impl Behavior<Buf> for Cli {
modules.resolve_cb(&self.state.dir, specifier, referrer)
}

fn recv(&mut self, control: Buf, zero_copy: deno_buf) -> (bool, Box<CliOp>) {
fn dispatch(
&mut self,
control: Buf,
zero_copy: deno_buf,
) -> (bool, Box<CliOp>) {
ops::dispatch(self, control, zero_copy)
}

0 comments on commit 64a16bf

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.