Skip to content

Commit

Permalink
rename Behavior::recv to Behavior::dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Mar 14, 2019
1 parent 04c14d5 commit 64a16bf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/http_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl Behavior<Record> for HttpBench {
unimplemented!()
}

fn recv(
fn dispatch(
&mut self,
record: Record,
zero_copy_buf: deno_buf,
Expand Down
10 changes: 7 additions & 3 deletions core/isolate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -409,7 +413,7 @@ mod tests {
None
}

fn recv(
fn dispatch(
&mut self,
_record: (),
_zero_copy_buf: deno_buf,
Expand Down
6 changes: 5 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 64a16bf

Please sign in to comment.