Skip to content

Commit

Permalink
DevTools - add Interrupt method to ThreadActor
Browse files Browse the repository at this point in the history
  • Loading branch information
codehag committed Oct 14, 2018
1 parent cdd7f0a commit 74e4407
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions components/devtools/actors/thread.rs
Expand Up @@ -33,6 +33,13 @@ struct ThreadResumedReply {
type_: String,
}

#[derive(Serialize)]
struct ThreadInterruptedReply {
from: String,
#[serde(rename = "type")]
type_: String,
}

#[derive(Serialize)]
struct ReconfigureReply {
from: String,
Expand Down Expand Up @@ -93,6 +100,15 @@ impl Actor for ThreadActor {
ActorMessageStatus::Processed
},

"interrupt" => {
let msg = ThreadInterruptedReply {
from: self.name(),
type_: "interrupted".to_owned(),
};
stream.write_json_packet(&msg);
ActorMessageStatus::Processed
},

"reconfigure" => {
stream.write_json_packet(&ReconfigureReply { from: self.name() });
ActorMessageStatus::Processed
Expand Down

0 comments on commit 74e4407

Please sign in to comment.