@@ -15,7 +15,7 @@ let executor = TickedAsyncExecutor::default();
15
15
16
16
executor . spawn_local (" MyIdentifier" , async move {}). detach ();
17
17
18
- // Make sure to tick your executor to run the tasks
18
+ // Tick your executor to run the tasks
19
19
assert_eq! (executor . num_tasks (), 1 );
20
20
executor . tick (DELTA , None );
21
21
assert_eq! (executor . num_tasks (), 0 );
@@ -48,11 +48,14 @@ const DELTA: f64 = 1000.0 / 60.0;
48
48
49
49
let executor = TickedAsyncExecutor :: default ();
50
50
51
- executor . spawn_local (" MyIdentifier" , async move {}). detach ();
51
+ executor . spawn_local (" MyIdentifier1" , async move {}). detach ();
52
+ executor . spawn_local (" MyIdentifier2" , async move {}). detach ();
52
53
53
- // Runs upto 10 woken tasks per tick
54
+ // Runs upto 1 woken tasks per tick
55
+ assert_eq! (executor . num_tasks (), 2 );
56
+ executor . tick (DELTA , Some (1 ));
54
57
assert_eq! (executor . num_tasks (), 1 );
55
- executor . tick (DELTA , Some (10 ));
58
+ executor . tick (DELTA , Some (1 ));
56
59
assert_eq! (executor . num_tasks (), 0 );
57
60
```
58
61
0 commit comments