mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-13 10:35:41 -04:00
Run event / notification handlers in separate async tasks
Prevents deadlocks when new handlers are registered from within an existing handler.
This commit is contained in:
@@ -2123,7 +2123,7 @@ impl Client {
|
||||
};
|
||||
|
||||
for notification in room_notifications {
|
||||
(handler)(notification.clone(), room.clone(), self.clone()).await;
|
||||
tokio::spawn((handler)(notification.clone(), room.clone(), self.clone()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ impl Client {
|
||||
room: room.clone(),
|
||||
raw: event.json(),
|
||||
};
|
||||
(handler)(data).await;
|
||||
tokio::spawn((handler)(data));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user