@@ -93,12 +93,12 @@ fn try_process_event(
93
93
ctx2. request_repaint ( ) ;
94
94
} ;
95
95
96
- app_ctx. pool . keepalive_ping ( wakeup) ;
96
+ app_ctx. subman . pool ( ) . keepalive_ping ( wakeup) ;
97
97
98
98
// NOTE: we don't use the while let loop due to borrow issues
99
99
#[ allow( clippy:: while_let_loop) ]
100
100
loop {
101
- let ev = if let Some ( ev) = app_ctx. pool . try_recv ( ) {
101
+ let ev = if let Some ( ev) = app_ctx. subman . pool ( ) . try_recv ( ) {
102
102
ev. into_owned ( )
103
103
} else {
104
104
break ;
@@ -108,14 +108,14 @@ fn try_process_event(
108
108
RelayEvent :: Opened => {
109
109
app_ctx
110
110
. accounts
111
- . send_initial_filters ( app_ctx. pool , & ev. relay ) ;
111
+ . send_initial_filters ( app_ctx. subman . pool ( ) , & ev. relay ) ;
112
112
113
113
timeline:: send_initial_timeline_filters (
114
114
app_ctx. ndb ,
115
115
damus. since_optimize ,
116
116
& mut damus. timeline_cache ,
117
117
& mut damus. subscriptions ,
118
- app_ctx. pool ,
118
+ app_ctx. subman . pool ( ) ,
119
119
& ev. relay ,
120
120
) ;
121
121
}
@@ -130,8 +130,12 @@ fn try_process_event(
130
130
}
131
131
132
132
for ( _kind, timeline) in damus. timeline_cache . timelines . iter_mut ( ) {
133
- let is_ready =
134
- timeline:: is_timeline_ready ( app_ctx. ndb , app_ctx. pool , app_ctx. note_cache , timeline) ;
133
+ let is_ready = timeline:: is_timeline_ready (
134
+ app_ctx. ndb ,
135
+ app_ctx. subman . pool ( ) ,
136
+ app_ctx. note_cache ,
137
+ timeline,
138
+ ) ;
135
139
136
140
if is_ready {
137
141
let txn = Transaction :: new ( app_ctx. ndb ) . expect ( "txn" ) ;
@@ -153,7 +157,7 @@ fn try_process_event(
153
157
}
154
158
155
159
if app_ctx. unknown_ids . ready_to_send ( ) {
156
- unknown_id_send ( app_ctx. unknown_ids , app_ctx. pool ) ;
160
+ unknown_id_send ( app_ctx. unknown_ids , app_ctx. subman . pool ( ) ) ;
157
161
}
158
162
159
163
Ok ( ( ) )
@@ -229,14 +233,14 @@ fn handle_eose(
229
233
) ;
230
234
// this is possible if this is the first time
231
235
if ctx. unknown_ids . ready_to_send ( ) {
232
- unknown_id_send ( ctx. unknown_ids , ctx. pool ) ;
236
+ unknown_id_send ( ctx. unknown_ids , ctx. subman . pool ( ) ) ;
233
237
}
234
238
}
235
239
236
240
// oneshot subs just close when they're done
237
241
SubKind :: OneShot => {
238
242
let msg = ClientMessage :: close ( subid. to_string ( ) ) ;
239
- ctx. pool . send_to ( & msg, relay_url) ;
243
+ ctx. subman . pool ( ) . send_to ( & msg, relay_url) ;
240
244
}
241
245
242
246
SubKind :: FetchingContactList ( timeline_uid) => {
@@ -287,12 +291,13 @@ fn handle_eose(
287
291
fn process_message ( damus : & mut Damus , ctx : & mut AppContext < ' _ > , relay : & str , msg : & RelayMessage ) {
288
292
match msg {
289
293
RelayMessage :: Event ( _subid, ev) => {
290
- let relay = if let Some ( relay) = ctx. pool . relays . iter ( ) . find ( |r| r. url ( ) == relay) {
291
- relay
292
- } else {
293
- error ! ( "couldn't find relay {} for note processing!?" , relay) ;
294
- return ;
295
- } ;
294
+ let relay =
295
+ if let Some ( relay) = ctx. subman . pool ( ) . relays . iter ( ) . find ( |r| r. url ( ) == relay) {
296
+ relay
297
+ } else {
298
+ error ! ( "couldn't find relay {} for note processing!?" , relay) ;
299
+ return ;
300
+ } ;
296
301
297
302
match relay {
298
303
PoolRelay :: Websocket ( _) => {
@@ -387,7 +392,7 @@ impl Damus {
387
392
& txn,
388
393
ctx. ndb ,
389
394
ctx. note_cache ,
390
- ctx. pool ,
395
+ ctx. subman . pool ( ) ,
391
396
& timeline_kind,
392
397
) {
393
398
add_result. process (
0 commit comments