@@ -49,7 +49,10 @@ impl SpaceService {
49
49
self . inner . joined_spaces ( ) . into_iter ( ) . map ( Into :: into) . collect ( )
50
50
}
51
51
52
- pub fn subscribe_to_joined_spaces ( & self , listener : Box < dyn SpaceServiceJoinedSpacesListener > ) {
52
+ pub fn subscribe_to_joined_spaces (
53
+ & self ,
54
+ listener : Box < dyn SpaceServiceJoinedSpacesListener > ,
55
+ ) -> Arc < TaskHandle > {
53
56
let entries_stream = self . inner . subscribe_to_joined_spaces ( ) ;
54
57
55
58
Arc :: new ( TaskHandle :: new ( get_runtime_handle ( ) . spawn ( async move {
@@ -58,7 +61,7 @@ impl SpaceService {
58
61
while let Some ( rooms) = entries_stream. next ( ) . await {
59
62
listener. on_update ( rooms. into_iter ( ) . map ( Into :: into) . collect ( ) ) ;
60
63
}
61
- } ) ) ) ;
64
+ } ) ) )
62
65
}
63
66
64
67
#[ allow( clippy:: unused_async) ]
@@ -95,7 +98,7 @@ impl SpaceServiceRoomList {
95
98
pub fn subscribe_to_pagiation_state_updates (
96
99
& self ,
97
100
listener : Box < dyn SpaceServiceRoomListPaginationStateListener > ,
98
- ) {
101
+ ) -> Arc < TaskHandle > {
99
102
let pagination_state = self . inner . subscribe_to_pagination_state_updates ( ) ;
100
103
101
104
Arc :: new ( TaskHandle :: new ( get_runtime_handle ( ) . spawn ( async move {
@@ -104,14 +107,17 @@ impl SpaceServiceRoomList {
104
107
while let Some ( state) = pagination_state. next ( ) . await {
105
108
listener. on_update ( state. into ( ) ) ;
106
109
}
107
- } ) ) ) ;
110
+ } ) ) )
108
111
}
109
112
110
113
pub fn rooms ( & self ) -> Vec < SpaceServiceRoom > {
111
114
self . inner . rooms ( ) . into_iter ( ) . map ( Into :: into) . collect ( )
112
115
}
113
116
114
- pub fn subscribe_to_room_update ( & self , listener : Box < dyn SpaceServiceRoomListEntriesListener > ) {
117
+ pub fn subscribe_to_room_update (
118
+ & self ,
119
+ listener : Box < dyn SpaceServiceRoomListEntriesListener > ,
120
+ ) -> Arc < TaskHandle > {
115
121
let entries_stream = self . inner . subscribe_to_room_updates ( ) ;
116
122
117
123
Arc :: new ( TaskHandle :: new ( get_runtime_handle ( ) . spawn ( async move {
@@ -120,7 +126,7 @@ impl SpaceServiceRoomList {
120
126
while let Some ( rooms) = entries_stream. next ( ) . await {
121
127
listener. on_update ( rooms. into_iter ( ) . map ( Into :: into) . collect ( ) ) ;
122
128
}
123
- } ) ) ) ;
129
+ } ) ) )
124
130
}
125
131
126
132
pub async fn paginate ( & self ) -> Result < ( ) , ClientError > {
0 commit comments