From 74e44078d7a9eff26db69f97da6582c968eb75b5 Mon Sep 17 00:00:00 2001 From: codehag Date: Sun, 14 Oct 2018 16:29:41 +0200 Subject: [PATCH] DevTools - add Interrupt method to ThreadActor --- components/devtools/actors/thread.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/components/devtools/actors/thread.rs b/components/devtools/actors/thread.rs index dc2638bd1354..131647f467c5 100644 --- a/components/devtools/actors/thread.rs +++ b/components/devtools/actors/thread.rs @@ -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, @@ -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