mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 22:36:30 +03:00
feat: use EventEmitter for events
This commit is contained in:
committed by
GitHub
parent
4b4e6e1732
commit
014d2946b2
@@ -38,10 +38,10 @@ async fn main() {
|
||||
let duration = time::Duration::from_millis(4000);
|
||||
println!("info: {:#?}", info);
|
||||
|
||||
let ctx1 = ctx.clone();
|
||||
let events = ctx.get_event_emitter();
|
||||
async_std::task::spawn(async move {
|
||||
loop {
|
||||
if let Ok(event) = ctx1.get_next_event() {
|
||||
if let Some(event) = events.recv().await {
|
||||
cb(event);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user