2323
2424use std:: { pin:: Pin , time:: Duration } ;
2525
26- use async_std:: task;
2726use criterion:: { black_box, criterion_group, criterion_main, Criterion , Throughput } ;
28- use futures:: {
29- channel:: oneshot,
30- future:: { join, poll_fn} ,
31- prelude:: * ,
32- } ;
27+ use futures:: { channel:: oneshot, future:: poll_fn, prelude:: * } ;
3328use libp2p_core:: {
3429 multiaddr:: multiaddr, muxing, muxing:: StreamMuxerExt , transport, transport:: ListenerId ,
3530 upgrade, Endpoint , Multiaddr , Transport ,
@@ -38,6 +33,7 @@ use libp2p_identity as identity;
3833use libp2p_identity:: PeerId ;
3934use libp2p_mplex as mplex;
4035use libp2p_plaintext as plaintext;
36+ use tokio:: runtime:: Runtime ;
4137use tracing_subscriber:: EnvFilter ;
4238
4339type BenchTransport = transport:: Boxed < ( PeerId , muxing:: StreamMuxerBox ) > ;
@@ -180,7 +176,10 @@ fn run(
180176 } ;
181177
182178 // Wait for all data to be received.
183- task:: block_on ( join ( sender, receiver) ) ;
179+ let rt = Runtime :: new ( ) . unwrap ( ) ;
180+ rt. block_on ( async {
181+ tokio:: join!( sender, receiver) ;
182+ } ) ;
184183}
185184
186185fn tcp_transport ( split_send_size : usize ) -> BenchTransport {
0 commit comments