feat: initial implementation of the account manager

This commit is contained in:
dignifiedquire
2020-07-30 17:26:06 +02:00
parent 04629c4b2e
commit 58a8ae1914
5 changed files with 459 additions and 1 deletions

View File

@@ -54,11 +54,15 @@ impl EventEmitter {
async_std::task::block_on(self.recv())
}
/// Blocking async recv of an event. Return `None` if the `Sender` has been droped.
/// Async recv of an event. Return `None` if the `Sender` has been droped.
pub async fn recv(&self) -> Option<Event> {
// TODO: change once we can use async channels internally.
self.0.recv().await.ok()
}
pub fn try_recv(&self) -> Result<Event, async_std::sync::TryRecvError> {
self.0.try_recv()
}
}
impl Event {