Browse Source

Send the protocol messages to the actor asynchronously

`send()` does not actually send anything unless its polled; convert to
`do_send_async()` like elsewhere to send the message.
fix-bad-api-calls
Mariusz Klochowicz 3 years ago
parent
commit
d407b7f654
No known key found for this signature in database GPG Key ID: 470C865699C8D4D
  1. 16
      daemon/src/maker_cfd_actor.rs

16
daemon/src/maker_cfd_actor.rs

@ -169,11 +169,19 @@ impl MakerCfdActor {
let (actor, inbox) = setup_contract_actor::new(
{
let inbox = self.takers()?.clone();
let takers = self.takers()?.clone();
move |msg| {
inbox.send(maker_inc_connections_actor::TakerMessage {
taker_id,
command: TakerCommand::OutProtocolMsg { setup_msg: msg },
tokio::spawn({
let inbox = takers.clone();
async move {
inbox
.do_send_async(maker_inc_connections_actor::TakerMessage {
taker_id,
command: TakerCommand::OutProtocolMsg { setup_msg: msg },
})
.await
.unwrap();
}
});
}
},

Loading…
Cancel
Save