mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 06:16:30 +03:00
feat: use EventEmitter for events
This commit is contained in:
committed by
GitHub
parent
4b4e6e1732
commit
014d2946b2
@@ -275,10 +275,10 @@ async fn start(args: Vec<String>) -> Result<(), Error> {
|
||||
}
|
||||
let context = Context::new("CLI".into(), Path::new(&args[1]).to_path_buf()).await?;
|
||||
|
||||
let ctx = context.clone();
|
||||
let events = context.get_event_emitter();
|
||||
async_std::task::spawn(async move {
|
||||
loop {
|
||||
if let Ok(event) = ctx.get_next_event() {
|
||||
if let Some(event) = events.recv().await {
|
||||
receive_event(event);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user