@@ -23,6 +23,7 @@ use linera_views::{
23
23
AdminKeyValueStore , CommonStoreInternalConfig , ReadableKeyValueStore , WithError ,
24
24
WritableKeyValueStore ,
25
25
} ,
26
+ FutureSyncExt ,
26
27
} ;
27
28
use serde:: de:: DeserializeOwned ;
28
29
use tonic:: transport:: { Channel , Endpoint } ;
@@ -97,7 +98,7 @@ impl ReadableKeyValueStore for ServiceStoreClientInternal {
97
98
let channel = self . channel . clone ( ) ;
98
99
let mut client = StoreProcessorClient :: new ( channel) ;
99
100
let _guard = self . acquire ( ) . await ;
100
- let response = client. process_read_value ( request) . await ?;
101
+ let response = client. process_read_value ( request) . make_sync ( ) . await ?;
101
102
let response = response. into_inner ( ) ;
102
103
let ReplyReadValue {
103
104
value,
@@ -120,7 +121,7 @@ impl ReadableKeyValueStore for ServiceStoreClientInternal {
120
121
let channel = self . channel . clone ( ) ;
121
122
let mut client = StoreProcessorClient :: new ( channel) ;
122
123
let _guard = self . acquire ( ) . await ;
123
- let response = client. process_contains_key ( request) . await ?;
124
+ let response = client. process_contains_key ( request) . make_sync ( ) . await ?;
124
125
let response = response. into_inner ( ) ;
125
126
let ReplyContainsKey { test } = response;
126
127
Ok ( test)
@@ -139,7 +140,7 @@ impl ReadableKeyValueStore for ServiceStoreClientInternal {
139
140
let channel = self . channel . clone ( ) ;
140
141
let mut client = StoreProcessorClient :: new ( channel) ;
141
142
let _guard = self . acquire ( ) . await ;
142
- let response = client. process_contains_keys ( request) . await ?;
143
+ let response = client. process_contains_keys ( request) . make_sync ( ) . await ?;
143
144
let response = response. into_inner ( ) ;
144
145
let ReplyContainsKeys { tests } = response;
145
146
Ok ( tests)
@@ -161,7 +162,10 @@ impl ReadableKeyValueStore for ServiceStoreClientInternal {
161
162
let channel = self . channel . clone ( ) ;
162
163
let mut client = StoreProcessorClient :: new ( channel) ;
163
164
let _guard = self . acquire ( ) . await ;
164
- let response = client. process_read_multi_values ( request) . await ?;
165
+ let response = client
166
+ . process_read_multi_values ( request)
167
+ . make_sync ( )
168
+ . await ?;
165
169
let response = response. into_inner ( ) ;
166
170
let ReplyReadMultiValues {
167
171
values,
@@ -193,7 +197,10 @@ impl ReadableKeyValueStore for ServiceStoreClientInternal {
193
197
let channel = self . channel . clone ( ) ;
194
198
let mut client = StoreProcessorClient :: new ( channel) ;
195
199
let _guard = self . acquire ( ) . await ;
196
- let response = client. process_find_keys_by_prefix ( request) . await ?;
200
+ let response = client
201
+ . process_find_keys_by_prefix ( request)
202
+ . make_sync ( )
203
+ . await ?;
197
204
let response = response. into_inner ( ) ;
198
205
let ReplyFindKeysByPrefix {
199
206
keys,
@@ -224,7 +231,10 @@ impl ReadableKeyValueStore for ServiceStoreClientInternal {
224
231
let channel = self . channel . clone ( ) ;
225
232
let mut client = StoreProcessorClient :: new ( channel) ;
226
233
let _guard = self . acquire ( ) . await ;
227
- let response = client. process_find_key_values_by_prefix ( request) . await ?;
234
+ let response = client
235
+ . process_find_key_values_by_prefix ( request)
236
+ . make_sync ( )
237
+ . await ?;
228
238
let response = response. into_inner ( ) ;
229
239
let ReplyFindKeyValuesByPrefix {
230
240
key_values,
@@ -340,7 +350,10 @@ impl ServiceStoreClientInternal {
340
350
let channel = self . channel . clone ( ) ;
341
351
let mut client = StoreProcessorClient :: new ( channel) ;
342
352
let _guard = self . acquire ( ) . await ;
343
- let _response = client. process_write_batch_extended ( request) . await ?;
353
+ let _response = client
354
+ . process_write_batch_extended ( request)
355
+ . make_sync ( )
356
+ . await ?;
344
357
}
345
358
Ok ( ( ) )
346
359
}
@@ -383,7 +396,7 @@ impl ServiceStoreClientInternal {
383
396
} ;
384
397
let request = tonic:: Request :: new ( query) ;
385
398
let mut client = StoreProcessorClient :: new ( channel) ;
386
- let response = client. process_specific_chunk ( request) . await ?;
399
+ let response = client. process_specific_chunk ( request) . make_sync ( ) . await ?;
387
400
let response = response. into_inner ( ) ;
388
401
let ReplySpecificChunk { chunk } = response;
389
402
Ok ( chunk)
@@ -458,8 +471,8 @@ impl AdminKeyValueStore for ServiceStoreClientInternal {
458
471
async fn list_all ( config : & Self :: Config ) -> Result < Vec < String > , ServiceStoreError > {
459
472
let endpoint = config. http_address ( ) ;
460
473
let endpoint = Endpoint :: from_shared ( endpoint) ?;
461
- let mut client = StoreProcessorClient :: connect ( endpoint) . await ?;
462
- let response = client. process_list_all ( ( ) ) . await ?;
474
+ let mut client = StoreProcessorClient :: connect ( endpoint) . make_sync ( ) . await ?;
475
+ let response = client. process_list_all ( ( ) ) . make_sync ( ) . await ?;
463
476
let response = response. into_inner ( ) ;
464
477
let ReplyListAll { namespaces } = response;
465
478
let namespaces = namespaces
@@ -478,8 +491,8 @@ impl AdminKeyValueStore for ServiceStoreClientInternal {
478
491
let request = tonic:: Request :: new ( query) ;
479
492
let endpoint = config. http_address ( ) ;
480
493
let endpoint = Endpoint :: from_shared ( endpoint) ?;
481
- let mut client = StoreProcessorClient :: connect ( endpoint) . await ?;
482
- let response = client. process_list_root_keys ( request) . await ?;
494
+ let mut client = StoreProcessorClient :: connect ( endpoint) . make_sync ( ) . await ?;
495
+ let response = client. process_list_root_keys ( request) . make_sync ( ) . await ?;
483
496
let response = response. into_inner ( ) ;
484
497
let ReplyListRootKeys { root_keys } = response;
485
498
Ok ( root_keys)
@@ -488,8 +501,8 @@ impl AdminKeyValueStore for ServiceStoreClientInternal {
488
501
async fn delete_all ( config : & Self :: Config ) -> Result < ( ) , ServiceStoreError > {
489
502
let endpoint = config. http_address ( ) ;
490
503
let endpoint = Endpoint :: from_shared ( endpoint) ?;
491
- let mut client = StoreProcessorClient :: connect ( endpoint) . await ?;
492
- let _response = client. process_delete_all ( ( ) ) . await ?;
504
+ let mut client = StoreProcessorClient :: connect ( endpoint) . make_sync ( ) . await ?;
505
+ let _response = client. process_delete_all ( ( ) ) . make_sync ( ) . await ?;
493
506
Ok ( ( ) )
494
507
}
495
508
@@ -499,8 +512,8 @@ impl AdminKeyValueStore for ServiceStoreClientInternal {
499
512
let request = tonic:: Request :: new ( query) ;
500
513
let endpoint = config. http_address ( ) ;
501
514
let endpoint = Endpoint :: from_shared ( endpoint) ?;
502
- let mut client = StoreProcessorClient :: connect ( endpoint) . await ?;
503
- let response = client. process_exists_namespace ( request) . await ?;
515
+ let mut client = StoreProcessorClient :: connect ( endpoint) . make_sync ( ) . await ?;
516
+ let response = client. process_exists_namespace ( request) . make_sync ( ) . await ?;
504
517
let response = response. into_inner ( ) ;
505
518
let ReplyExistsNamespace { exists } = response;
506
519
Ok ( exists)
@@ -515,8 +528,8 @@ impl AdminKeyValueStore for ServiceStoreClientInternal {
515
528
let request = tonic:: Request :: new ( query) ;
516
529
let endpoint = config. http_address ( ) ;
517
530
let endpoint = Endpoint :: from_shared ( endpoint) ?;
518
- let mut client = StoreProcessorClient :: connect ( endpoint) . await ?;
519
- let _response = client. process_create_namespace ( request) . await ?;
531
+ let mut client = StoreProcessorClient :: connect ( endpoint) . make_sync ( ) . await ?;
532
+ let _response = client. process_create_namespace ( request) . make_sync ( ) . await ?;
520
533
Ok ( ( ) )
521
534
}
522
535
@@ -526,8 +539,8 @@ impl AdminKeyValueStore for ServiceStoreClientInternal {
526
539
let request = tonic:: Request :: new ( query) ;
527
540
let endpoint = config. http_address ( ) ;
528
541
let endpoint = Endpoint :: from_shared ( endpoint) ?;
529
- let mut client = StoreProcessorClient :: connect ( endpoint) . await ?;
530
- let _response = client. process_delete_namespace ( request) . await ?;
542
+ let mut client = StoreProcessorClient :: connect ( endpoint) . make_sync ( ) . await ?;
543
+ let _response = client. process_delete_namespace ( request) . make_sync ( ) . await ?;
531
544
Ok ( ( ) )
532
545
}
533
546
}
0 commit comments