Skip to content

Commit ea877dd

Browse files
committed
Split the FirmwareManagerMessageBox into a Receiver and a Worker
The idea is to have a worker which is Clone with methods that can be spawned in background tasks. The actor itself keeps only stateful things that cannot be shared (the message receiver and the cache of pending operations). This is an intermediate step. All the methods are for now still attached to the actor. The next step will be to move out from the actor to the worker all the methods that doesn't touch the actor state. Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
1 parent defa13f commit ea877dd

File tree

4 files changed

+102
-83
lines changed

4 files changed

+102
-83
lines changed

crates/core/tedge_actors/src/servers/message_boxes.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ pub struct ClientMessageBox<Request, Response> {
101101
sender: DynSender<RequestEnvelope<Request, Response>>,
102102
}
103103

104+
impl<Request: Message, Response: Message> Clone for ClientMessageBox<Request, Response> {
105+
fn clone(&self) -> Self {
106+
ClientMessageBox {
107+
sender: self.sender.sender_clone(),
108+
}
109+
}
110+
}
111+
104112
impl<Request: Message, Response: Message> ClientMessageBox<Request, Response> {
105113
/// Create a [ClientMessageBox] connected to a given [Server]
106114
pub fn new(

0 commit comments

Comments
 (0)