diff --git a/matrix_sdk/src/client.rs b/matrix_sdk/src/client.rs index cd0e8a02..ba261ce0 100644 --- a/matrix_sdk/src/client.rs +++ b/matrix_sdk/src/client.rs @@ -2130,7 +2130,11 @@ impl Client { }; for notification in room_notifications { - tokio::spawn((handler)(notification.clone(), room.clone(), self.clone())); + matrix_sdk_common::executor::spawn((handler)( + notification.clone(), + room.clone(), + self.clone(), + )); } } } diff --git a/matrix_sdk/src/event_handler.rs b/matrix_sdk/src/event_handler.rs index ba1a031c..60799eab 100644 --- a/matrix_sdk/src/event_handler.rs +++ b/matrix_sdk/src/event_handler.rs @@ -306,7 +306,7 @@ impl Client { room: room.clone(), raw: event.json(), }; - tokio::spawn((handler)(data)); + matrix_sdk_common::executor::spawn((handler)(data)); } } }