diff options
Diffstat (limited to 'lib/src/reactor/ctrl.rs')
-rw-r--r-- | lib/src/reactor/ctrl.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/src/reactor/ctrl.rs b/lib/src/reactor/ctrl.rs new file mode 100644 index 0000000..a32f1c3 --- /dev/null +++ b/lib/src/reactor/ctrl.rs @@ -0,0 +1,15 @@ +use tokio::sync::mpsc::UnboundedSender as Sender; +use tokio::sync::mpsc::UnboundedReceiver as Receiver; + +/// Type for sending messages to a reactor +pub type ReactorSender<Request, Reply> = Sender<(Request, ReplySender<Reply>)>; + +/// Type that is used by a reactor for receiving messages +pub type ReactorReceiver<Request, Reply> = Receiver<(Request, ReplySender<Reply>)>; + +/// Type that represents the channel that has to be send with a request to a reactor for getting an +/// answer back +pub type ReplySender<Reply> = Sender<Reply>; + +pub type ReplyReceiver<Reply> = Receiver<Reply>; + |