Skip to content

Commit

Permalink
Agent::handle -> Agent::handle_input
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-peterson committed Dec 8, 2019
1 parent df16e2d commit 844c28e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl Agent for Worker {
fn update(&mut self, msg: Self::Message) { /* ... */ }

// Handle incoming messages from components of other agents.
fn handle(&mut self, msg: Self::Input, who: HandlerId) {
fn handle_input(&mut self, msg: Self::Input, who: HandlerId) {
match msg {
Request::Question(_) => {
self.link.respond(who, Response::Answer("That's cool!".into()));
Expand Down
2 changes: 1 addition & 1 deletion examples/multi_thread/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl Agent for Worker {
}
}

fn handle(&mut self, msg: Self::Input, who: HandlerId) {
fn handle_input(&mut self, msg: Self::Input, who: HandlerId) {
info!("Request: {:?}", msg);
match msg {
Request::GetDataFromServer => {
Expand Down
2 changes: 1 addition & 1 deletion examples/multi_thread/src/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl Agent for Worker {
}
}

fn handle(&mut self, msg: Self::Input, who: HandlerId) {
fn handle_input(&mut self, msg: Self::Input, who: HandlerId) {
info!("Request: {:?}", msg);
match msg {
Request::GetDataFromServer => {
Expand Down
2 changes: 1 addition & 1 deletion examples/multi_thread/src/native_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl Agent for Worker {
}
}

fn handle(&mut self, msg: Self::Input, who: HandlerId) {
fn handle_input(&mut self, msg: Self::Input, who: HandlerId) {
info!("Request: {:?}", msg);
match msg {
Request::GetDataFromServer => {
Expand Down
2 changes: 1 addition & 1 deletion examples/routing/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ where
}
}

fn handle(&mut self, msg: Self::Input, who: HandlerId) {
fn handle_input(&mut self, msg: Self::Input, who: HandlerId) {
info!("Request: {:?}", msg);
match msg {
Request::ChangeRoute(route) => {
Expand Down
4 changes: 2 additions & 2 deletions src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ pub trait Agent: Sized + 'static {
fn connected(&mut self, _id: HandlerId) {}

/// This method called on every incoming message.
fn handle(&mut self, msg: Self::Input, id: HandlerId);
fn handle_input(&mut self, msg: Self::Input, id: HandlerId);

/// This method called on when a new bridge destroyed.
fn disconnected(&mut self, _id: HandlerId) {}
Expand Down Expand Up @@ -877,7 +877,7 @@ where
this.agent
.as_mut()
.expect("agent was not created to process inputs")
.handle(inp, id);
.handle_input(inp, id);
}
AgentLifecycleEvent::Disconnected(id) => {
this.agent
Expand Down

0 comments on commit 844c28e

Please sign in to comment.