File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,28 @@ impl<RK: RuntimeKit + 'static> Executor for Runtime<RK> {
4949 }
5050}
5151
52+ #[ async_trait]
53+ impl < RK : RuntimeKit + Sync + ' static > Reactor for Runtime < RK > {
54+ fn register < H : IO + Send + ' static > (
55+ & self ,
56+ socket : IOHandle < H > ,
57+ ) -> io:: Result < impl AsyncIOHandle + Send > {
58+ self . kit . register ( socket)
59+ }
60+
61+ async fn sleep ( & self , dur : Duration ) {
62+ self . kit . sleep ( dur) . await ;
63+ }
64+
65+ fn interval ( & self , dur : Duration ) -> impl Stream < Item = Instant > {
66+ self . kit . interval ( dur)
67+ }
68+
69+ async fn tcp_connect ( & self , addr : SocketAddr ) -> io:: Result < impl AsyncIOHandle + Send > {
70+ self . kit . tcp_connect ( addr) . await
71+ }
72+ }
73+
5274/// Wrapper around separate Executor and Reactor implementing RuntimeKit
5375#[ derive( Debug ) ]
5476pub struct RuntimeParts < E : Executor , R : Reactor > {
You can’t perform that action at this time.
0 commit comments