Actor::handle_message should return an enum instad of a boolean #7110 r=jdm

This commit is contained in:
Fabrice Desré 2015-08-13 18:14:34 -07:00
parent f5e97ef1b5
commit c7b48240b0
12 changed files with 83 additions and 76 deletions

View file

@ -15,6 +15,12 @@ use std::net::TcpStream;
use std::raw::TraitObject; use std::raw::TraitObject;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
#[derive(PartialEq)]
pub enum ActorMessageStatus {
Processed,
Ignored,
}
/// A common trait for all devtools actors that encompasses an immutable name /// A common trait for all devtools actors that encompasses an immutable name
/// and the ability to process messages that are directed to particular actors. /// and the ability to process messages that are directed to particular actors.
/// TODO: ensure the name is immutable /// TODO: ensure the name is immutable
@ -23,7 +29,7 @@ pub trait Actor: Any {
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
msg: &json::Object, msg: &json::Object,
stream: &mut TcpStream) -> Result<bool, ()>; stream: &mut TcpStream) -> Result<ActorMessageStatus, ()>;
fn name(&self) -> String; fn name(&self) -> String;
} }
@ -194,7 +200,8 @@ impl ActorRegistry {
None => println!("message received for unknown actor \"{}\"", to), None => println!("message received for unknown actor \"{}\"", to),
Some(actor) => { Some(actor) => {
let msg_type = msg.get("type").unwrap().as_string().unwrap(); let msg_type = msg.get("type").unwrap().as_string().unwrap();
if !try!(actor.handle_message(self, &msg_type.to_string(), msg, stream)) { if try!(actor.handle_message(self, &msg_type.to_string(), msg, stream))
!= ActorMessageStatus::Processed {
println!("unexpected message type \"{}\" found for actor \"{}\"", println!("unexpected message type \"{}\" found for actor \"{}\"",
msg_type, to); msg_type, to);
} }

View file

@ -7,7 +7,7 @@
//! Mediates interaction between the remote web console and equivalent functionality (object //! Mediates interaction between the remote web console and equivalent functionality (object
//! inspection, JS evaluation, autocompletion) in Servo. //! inspection, JS evaluation, autocompletion) in Servo.
use actor::{Actor, ActorRegistry}; use actor::{Actor, ActorRegistry, ActorMessageStatus};
use actors::object::ObjectActor; use actors::object::ObjectActor;
use protocol::JsonPacketStream; use protocol::JsonPacketStream;
@ -96,7 +96,7 @@ impl Actor for ConsoleActor {
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
msg: &json::Object, msg: &json::Object,
stream: &mut TcpStream) -> Result<bool, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"getCachedMessages" => { "getCachedMessages" => {
let str_types = msg.get("messageTypes").unwrap().as_array().unwrap().into_iter().map(|json_type| { let str_types = msg.get("messageTypes").unwrap().as_array().unwrap().into_iter().map(|json_type| {
@ -124,7 +124,7 @@ impl Actor for ConsoleActor {
messages: messages, messages: messages,
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
"startListeners" => { "startListeners" => {
@ -139,7 +139,7 @@ impl Actor for ConsoleActor {
} }
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
"stopListeners" => { "stopListeners" => {
@ -155,7 +155,7 @@ impl Actor for ConsoleActor {
.collect(), .collect(),
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
//TODO: implement autocompletion like onAutocomplete in //TODO: implement autocompletion like onAutocomplete in
@ -167,7 +167,7 @@ impl Actor for ConsoleActor {
matchProp: "".to_string(), matchProp: "".to_string(),
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
"evaluateJS" => { "evaluateJS" => {
@ -237,10 +237,10 @@ impl Actor for ConsoleActor {
helperResult: Json::Object(BTreeMap::new()), helperResult: Json::Object(BTreeMap::new()),
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
_ => false _ => ActorMessageStatus::Ignored
}) })
} }
} }

View file

@ -10,7 +10,7 @@ use std::sync::{Arc, Mutex};
use time::precise_time_ns; use time::precise_time_ns;
use msg::constellation_msg::PipelineId; use msg::constellation_msg::PipelineId;
use actor::{Actor, ActorRegistry}; use actor::{Actor, ActorRegistry, ActorMessageStatus};
use actors::timeline::HighResolutionStamp; use actors::timeline::HighResolutionStamp;
use devtools_traits::DevtoolScriptControlMsg; use devtools_traits::DevtoolScriptControlMsg;
@ -33,8 +33,8 @@ impl Actor for FramerateActor {
_registry: &ActorRegistry, _registry: &ActorRegistry,
_msg_type: &str, _msg_type: &str,
_msg: &json::Object, _msg: &json::Object,
_stream: &mut TcpStream) -> Result<bool, ()> { _stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(false) Ok(ActorMessageStatus::Ignored)
} }
} }

View file

@ -9,7 +9,7 @@ use devtools_traits::{DevtoolScriptControlMsg, NodeInfo, ComputedNodeLayout};
use devtools_traits::DevtoolScriptControlMsg::{GetRootNode, GetDocumentElement, GetChildren}; use devtools_traits::DevtoolScriptControlMsg::{GetRootNode, GetDocumentElement, GetChildren};
use devtools_traits::DevtoolScriptControlMsg::{GetLayout, ModifyAttribute}; use devtools_traits::DevtoolScriptControlMsg::{GetLayout, ModifyAttribute};
use actor::{Actor, ActorRegistry}; use actor::{Actor, ActorRegistry, ActorMessageStatus};
use protocol::JsonPacketStream; use protocol::JsonPacketStream;
use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::ipc::{self, IpcSender};
@ -69,14 +69,14 @@ impl Actor for HighlighterActor {
_registry: &ActorRegistry, _registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
_msg: &json::Object, _msg: &json::Object,
stream: &mut TcpStream) -> Result<bool, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"showBoxModel" => { "showBoxModel" => {
let msg = ShowBoxModelReply { let msg = ShowBoxModelReply {
from: self.name(), from: self.name(),
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
"hideBoxModel" => { "hideBoxModel" => {
@ -84,10 +84,10 @@ impl Actor for HighlighterActor {
from: self.name(), from: self.name(),
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
_ => false, _ => ActorMessageStatus::Ignored,
}) })
} }
} }
@ -106,7 +106,7 @@ impl Actor for NodeActor {
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
msg: &json::Object, msg: &json::Object,
stream: &mut TcpStream) -> Result<bool, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"modifyAttributes" => { "modifyAttributes" => {
let target = msg.get(&"to".to_string()).unwrap().as_string().unwrap(); let target = msg.get(&"to".to_string()).unwrap().as_string().unwrap();
@ -123,10 +123,10 @@ impl Actor for NodeActor {
from: self.name(), from: self.name(),
}; };
stream.write_json_packet(&reply); stream.write_json_packet(&reply);
true ActorMessageStatus::Processed
} }
_ => false, _ => ActorMessageStatus::Ignored,
}) })
} }
} }
@ -280,14 +280,14 @@ impl Actor for WalkerActor {
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
msg: &json::Object, msg: &json::Object,
stream: &mut TcpStream) -> Result<bool, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"querySelector" => { "querySelector" => {
let msg = QuerySelectorReply { let msg = QuerySelectorReply {
from: self.name(), from: self.name(),
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
"documentElement" => { "documentElement" => {
@ -301,7 +301,7 @@ impl Actor for WalkerActor {
node: node, node: node,
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
"clearPseudoClassLocks" => { "clearPseudoClassLocks" => {
@ -309,7 +309,7 @@ impl Actor for WalkerActor {
from: self.name(), from: self.name(),
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
"children" => { "children" => {
@ -330,10 +330,10 @@ impl Actor for WalkerActor {
from: self.name(), from: self.name(),
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
_ => false, _ => ActorMessageStatus::Ignored,
}) })
} }
} }
@ -426,7 +426,7 @@ impl Actor for PageStyleActor {
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
msg: &json::Object, msg: &json::Object,
stream: &mut TcpStream) -> Result<bool, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"getApplied" => { "getApplied" => {
//TODO: query script for relevant applied styles to node (msg.node) //TODO: query script for relevant applied styles to node (msg.node)
@ -437,7 +437,7 @@ impl Actor for PageStyleActor {
from: self.name(), from: self.name(),
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
"getComputed" => { "getComputed" => {
@ -447,7 +447,7 @@ impl Actor for PageStyleActor {
from: self.name(), from: self.name(),
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
//TODO: query script for box layout properties of node (msg.node) //TODO: query script for box layout properties of node (msg.node)
@ -484,10 +484,10 @@ impl Actor for PageStyleActor {
from: self.name(), from: self.name(),
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
_ => false, _ => ActorMessageStatus::Ignored,
}) })
} }
} }
@ -501,7 +501,7 @@ impl Actor for InspectorActor {
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
_msg: &json::Object, _msg: &json::Object,
stream: &mut TcpStream) -> Result<bool, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"getWalker" => { "getWalker" => {
if self.walker.borrow().is_none() { if self.walker.borrow().is_none() {
@ -529,7 +529,7 @@ impl Actor for InspectorActor {
} }
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
"getPageStyle" => { "getPageStyle" => {
@ -551,7 +551,7 @@ impl Actor for InspectorActor {
}, },
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
//TODO: this is an old message; try adding highlightable to the root traits instead //TODO: this is an old message; try adding highlightable to the root traits instead
@ -574,10 +574,10 @@ impl Actor for InspectorActor {
}, },
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
_ => false, _ => ActorMessageStatus::Ignored,
}) })
} }
} }

View file

@ -5,7 +5,7 @@
use rustc_serialize::json; use rustc_serialize::json;
use std::net::TcpStream; use std::net::TcpStream;
use actor::{Actor, ActorRegistry}; use actor::{Actor, ActorRegistry, ActorMessageStatus};
#[derive(RustcEncodable)] #[derive(RustcEncodable)]
pub struct TimelineMemoryReply { pub struct TimelineMemoryReply {
@ -33,8 +33,8 @@ impl Actor for MemoryActor {
_registry: &ActorRegistry, _registry: &ActorRegistry,
_msg_type: &str, _msg_type: &str,
_msg: &json::Object, _msg: &json::Object,
_stream: &mut TcpStream) -> Result<bool, ()> { _stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(false) Ok(ActorMessageStatus::Ignored)
} }
} }

View file

@ -8,7 +8,7 @@
extern crate hyper; extern crate hyper;
use actor::{Actor, ActorRegistry}; use actor::{Actor, ActorRegistry, ActorMessageStatus};
use protocol::JsonPacketStream; use protocol::JsonPacketStream;
use rustc_serialize::json; use rustc_serialize::json;
use std::net::TcpStream; use std::net::TcpStream;
@ -74,7 +74,7 @@ impl Actor for NetworkEventActor {
_registry: &ActorRegistry, _registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
_msg: &json::Object, _msg: &json::Object,
stream: &mut TcpStream) -> Result<bool, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"getRequestHeaders" => { "getRequestHeaders" => {
// TODO: Pass the correct values for headers, headerSize, rawHeaders // TODO: Pass the correct values for headers, headerSize, rawHeaders
@ -85,24 +85,24 @@ impl Actor for NetworkEventActor {
rawHeaders: "Raw headers".to_string(), rawHeaders: "Raw headers".to_string(),
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
"getRequestCookies" => { "getRequestCookies" => {
false ActorMessageStatus::Ignored
} }
"getRequestPostData" => { "getRequestPostData" => {
false ActorMessageStatus::Ignored
} }
"getResponseHeaders" => { "getResponseHeaders" => {
false ActorMessageStatus::Ignored
} }
"getResponseCookies" => { "getResponseCookies" => {
false ActorMessageStatus::Ignored
} }
"getResponseContent" => { "getResponseContent" => {
false ActorMessageStatus::Ignored
} }
_ => false _ => ActorMessageStatus::Ignored
}) })
} }
} }

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use actor::{Actor, ActorRegistry}; use actor::{Actor, ActorRegistry, ActorMessageStatus};
use rustc_serialize::json; use rustc_serialize::json;
use std::net::TcpStream; use std::net::TcpStream;
@ -19,8 +19,8 @@ impl Actor for ObjectActor {
_: &ActorRegistry, _: &ActorRegistry,
_: &str, _: &str,
_: &json::Object, _: &json::Object,
_: &mut TcpStream) -> Result<bool, ()> { _: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(false) Ok(ActorMessageStatus::Ignored)
} }
} }

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use actor::{Actor, ActorRegistry}; use actor::{Actor, ActorRegistry, ActorMessageStatus};
use rustc_serialize::json; use rustc_serialize::json;
use std::net::TcpStream; use std::net::TcpStream;
@ -20,8 +20,8 @@ impl Actor for ProfilerActor {
_registry: &ActorRegistry, _registry: &ActorRegistry,
_msg_type: &str, _msg_type: &str,
_msg: &json::Object, _msg: &json::Object,
_stream: &mut TcpStream) -> Result<bool, ()> { _stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(false) Ok(ActorMessageStatus::Ignored)
} }
} }

View file

@ -7,7 +7,7 @@
/// Connection point for all new remote devtools interactions, providing lists of know actors /// Connection point for all new remote devtools interactions, providing lists of know actors
/// that perform more specific actions (tabs, addons, browser chrome, etc.) /// that perform more specific actions (tabs, addons, browser chrome, etc.)
use actor::{Actor, ActorRegistry}; use actor::{Actor, ActorRegistry, ActorMessageStatus};
use actors::tab::{TabActor, TabActorMsg}; use actors::tab::{TabActor, TabActorMsg};
use protocol::JsonPacketStream; use protocol::JsonPacketStream;
@ -55,7 +55,7 @@ impl Actor for RootActor {
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
_msg: &json::Object, _msg: &json::Object,
stream: &mut TcpStream) -> Result<bool, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"listAddons" => { "listAddons" => {
let actor = ErrorReply { let actor = ErrorReply {
@ -64,7 +64,7 @@ impl Actor for RootActor {
message: "This root actor has no browser addons.".to_string(), message: "This root actor has no browser addons.".to_string(),
}; };
stream.write_json_packet(&actor); stream.write_json_packet(&actor);
true ActorMessageStatus::Processed
} }
//https://wiki.mozilla.org/Remote_Debugging_Protocol#Listing_Browser_Tabs //https://wiki.mozilla.org/Remote_Debugging_Protocol#Listing_Browser_Tabs
@ -77,10 +77,10 @@ impl Actor for RootActor {
}).collect() }).collect()
}; };
stream.write_json_packet(&actor); stream.write_json_packet(&actor);
true ActorMessageStatus::Processed
} }
_ => false _ => ActorMessageStatus::Ignored
}) })
} }
} }

View file

@ -7,7 +7,7 @@
//! Connection point for remote devtools that wish to investigate a particular tab's contents. //! Connection point for remote devtools that wish to investigate a particular tab's contents.
//! Supports dynamic attaching and detaching which control notifications of navigation, etc. //! Supports dynamic attaching and detaching which control notifications of navigation, etc.
use actor::{Actor, ActorRegistry}; use actor::{Actor, ActorRegistry, ActorMessageStatus};
use actors::console::ConsoleActor; use actors::console::ConsoleActor;
use devtools_traits::DevtoolScriptControlMsg::WantsLiveNotifications; use devtools_traits::DevtoolScriptControlMsg::WantsLiveNotifications;
use protocol::JsonPacketStream; use protocol::JsonPacketStream;
@ -84,11 +84,11 @@ impl Actor for TabActor {
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
_msg: &json::Object, _msg: &json::Object,
stream: &mut TcpStream) -> Result<bool, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"reconfigure" => { "reconfigure" => {
stream.write_json_packet(&ReconfigureReply { from: self.name() }); stream.write_json_packet(&ReconfigureReply { from: self.name() });
true ActorMessageStatus::Processed
} }
// https://wiki.mozilla.org/Remote_Debugging_Protocol#Listing_Browser_Tabs // https://wiki.mozilla.org/Remote_Debugging_Protocol#Listing_Browser_Tabs
@ -107,7 +107,7 @@ impl Actor for TabActor {
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
console_actor.script_chan.send( console_actor.script_chan.send(
WantsLiveNotifications(console_actor.pipeline, true)).unwrap(); WantsLiveNotifications(console_actor.pipeline, true)).unwrap();
true ActorMessageStatus::Processed
} }
//FIXME: The current implementation won't work for multiple connections. Need to ensure 105 //FIXME: The current implementation won't work for multiple connections. Need to ensure 105
@ -122,7 +122,7 @@ impl Actor for TabActor {
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
console_actor.script_chan.send( console_actor.script_chan.send(
WantsLiveNotifications(console_actor.pipeline, false)).unwrap(); WantsLiveNotifications(console_actor.pipeline, false)).unwrap();
true ActorMessageStatus::Processed
} }
"listFrames" => { "listFrames" => {
@ -131,10 +131,10 @@ impl Actor for TabActor {
frames: vec!(), frames: vec!(),
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
_ => false _ => ActorMessageStatus::Ignored
}) })
} }
} }

View file

@ -13,7 +13,7 @@ use std::thread::sleep_ms;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use std::sync::mpsc::channel; use std::sync::mpsc::channel;
use actor::{Actor, ActorRegistry}; use actor::{Actor, ActorRegistry, ActorMessageStatus};
use actors::memory::{MemoryActor, TimelineMemoryReply}; use actors::memory::{MemoryActor, TimelineMemoryReply};
use actors::framerate::FramerateActor; use actors::framerate::FramerateActor;
use devtools_traits::DevtoolScriptControlMsg; use devtools_traits::DevtoolScriptControlMsg;
@ -232,7 +232,7 @@ impl Actor for TimelineActor {
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
msg: &json::Object, msg: &json::Object,
stream: &mut TcpStream) -> Result<bool, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"start" => { "start" => {
**self.is_recording.lock().as_mut().unwrap() = true; **self.is_recording.lock().as_mut().unwrap() = true;
@ -275,7 +275,7 @@ impl Actor for TimelineActor {
value: HighResolutionStamp::new(registry.start_stamp(), PreciseTime::now()), value: HighResolutionStamp::new(registry.start_stamp(), PreciseTime::now()),
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
"stop" => { "stop" => {
@ -297,7 +297,7 @@ impl Actor for TimelineActor {
**self.is_recording.lock().as_mut().unwrap() = false; **self.is_recording.lock().as_mut().unwrap() = false;
self.stream.borrow_mut().take(); self.stream.borrow_mut().take();
true ActorMessageStatus::Processed
} }
"isRecording" => { "isRecording" => {
@ -307,11 +307,11 @@ impl Actor for TimelineActor {
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
true ActorMessageStatus::Processed
} }
_ => { _ => {
false ActorMessageStatus::Ignored
} }
}) })
} }

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use actor::{Actor, ActorRegistry}; use actor::{Actor, ActorRegistry, ActorMessageStatus};
use msg::constellation_msg::WorkerId; use msg::constellation_msg::WorkerId;
use rustc_serialize::json; use rustc_serialize::json;
use std::net::TcpStream; use std::net::TcpStream;
@ -21,7 +21,7 @@ impl Actor for WorkerActor {
_: &ActorRegistry, _: &ActorRegistry,
_: &str, _: &str,
_: &json::Object, _: &json::Object,
_: &mut TcpStream) -> Result<bool, ()> { _: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(true) Ok(ActorMessageStatus::Processed)
} }
} }