@@ -10,6 +10,7 @@ use aws_sdk_sqs::{
10
10
types:: { error:: ReceiptHandleIsInvalid , Message , SendMessageBatchRequestEntry } ,
11
11
Client ,
12
12
} ;
13
+ use futures_util:: FutureExt as _;
13
14
use serde:: Serialize ;
14
15
15
16
#[ allow( deprecated) ]
@@ -49,10 +50,17 @@ impl SqsConfigFull {
49
50
& aws_config:: from_env ( )
50
51
. endpoint_url ( & self . queue_dsn )
51
52
. load ( )
53
+ // Segment the async state machine. load future is >7kb at the time of writing.
54
+ . boxed ( )
52
55
. await ,
53
56
)
54
57
} else {
55
- aws_sdk_sqs:: Config :: from ( & aws_config:: load_from_env ( ) . await )
58
+ aws_sdk_sqs:: Config :: from (
59
+ & aws_config:: load_from_env ( )
60
+ // Same as above
61
+ . boxed ( )
62
+ . await ,
63
+ )
56
64
}
57
65
}
58
66
}
@@ -205,6 +213,8 @@ impl Acker for SqsAcker {
205
213
. queue_url ( & self . queue_dsn )
206
214
. receipt_handle ( receipt_handle)
207
215
. send ( )
216
+ // Segment the async state machine. send future is >5kb at the time of writing.
217
+ . boxed ( )
208
218
. await
209
219
. map_err ( aws_to_queue_error) ?;
210
220
@@ -241,6 +251,8 @@ impl Acker for SqsAcker {
241
251
. queue_url ( & self . queue_dsn )
242
252
. receipt_handle ( receipt_handle)
243
253
. send ( )
254
+ // Segment the async state machine. send future is >5kb at the time of writing.
255
+ . boxed ( )
244
256
. await
245
257
. map_err ( aws_to_queue_error) ?;
246
258
@@ -294,6 +306,8 @@ impl SqsProducer {
294
306
. message_body ( payload)
295
307
. delay_seconds ( delay. as_secs ( ) . try_into ( ) . map_err ( QueueError :: generic) ?)
296
308
. send ( )
309
+ // Segment the async state machine. send future is >5kb at the time of writing.
310
+ . boxed ( )
297
311
. await
298
312
. map_err ( aws_to_queue_error) ?;
299
313
@@ -349,6 +363,8 @@ impl SqsProducer {
349
363
. queue_url ( & self . queue_dsn )
350
364
. set_entries ( Some ( entries) )
351
365
. send ( )
366
+ // Segment the async state machine. send future is >5kb at the time of writing.
367
+ . boxed ( )
352
368
. await
353
369
. map_err ( aws_to_queue_error) ?;
354
370
}
@@ -414,6 +430,8 @@ impl SqsConsumer {
414
430
. set_max_number_of_messages ( Some ( 1 ) )
415
431
. queue_url ( & self . queue_dsn )
416
432
. send ( )
433
+ // Segment the async state machine. send future is >5kb at the time of writing.
434
+ . boxed ( )
417
435
. await
418
436
. map_err ( aws_to_queue_error) ?;
419
437
@@ -438,6 +456,8 @@ impl SqsConsumer {
438
456
. set_max_number_of_messages ( Some ( max_messages. try_into ( ) . map_err ( QueueError :: generic) ?) )
439
457
. queue_url ( & self . queue_dsn )
440
458
. send ( )
459
+ // Segment the async state machine. send future is >5kb at the time of writing.
460
+ . boxed ( )
441
461
. await
442
462
. map_err ( aws_to_queue_error) ?;
443
463
0 commit comments