1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use futures::sync::mpsc::UnboundedSender;

#[derive(Debug)]
pub enum BrokerRequest {
    Subscribe {
        id: String,
        subject: String,
        response_sender: UnboundedSender<BrokerResponse>,
    },
    Unsubscribe {
        id: String,
    },
    PostMessage {
        subject: String,
        payload: String,
        reply_to: String,
        message_expiration_in_seconds: Option<u32>,
    },
}

#[derive(Debug)]
pub enum BrokerResponse {
    Message {
        subject: String,
        payload: String,
        reply_to: String,
    },
}