File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -75,10 +75,10 @@ impl Poller {
75
75
// to convert it back to the right keys for the wakers. Earlier we
76
76
// established a positional index -> waker key relationship, so we can
77
77
// go right ahead and perform a lookup there.
78
- ready_indexes
78
+ dbg ! ( ready_indexes
79
79
. into_iter( )
80
80
. map( |index| EventKey ( indexes[ index as usize ] as u32 ) )
81
- . collect ( )
81
+ . collect( ) )
82
82
}
83
83
}
84
84
Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ impl Reactor {
128
128
for key in reactor. poller . block_until ( ) {
129
129
for ( waitee, waker) in reactor. wakers . iter ( ) {
130
130
if waitee. pollable . 0 . key == key {
131
+ println ! ( "waking {key:?}" ) ;
131
132
waker. wake_by_ref ( )
132
133
}
133
134
}
@@ -175,3 +176,17 @@ impl Reactor {
175
176
p. wait_for ( ) . await
176
177
}
177
178
}
179
+
180
+ #[ cfg( test) ]
181
+ mod test {
182
+ use super :: * ;
183
+ #[ test]
184
+ fn reactor_subscribe_duration ( ) {
185
+ crate :: runtime:: block_on ( async {
186
+ let reactor = Reactor :: current ( ) ;
187
+ let pollable = wasi:: clocks:: monotonic_clock:: subscribe_duration ( 1000 ) ;
188
+ let sched = reactor. schedule ( pollable) ;
189
+ sched. wait_for ( ) . await ;
190
+ } )
191
+ }
192
+ }
You can’t perform that action at this time.
0 commit comments