Commit a26e594
authored
Sleep trait (#665)
This enables customizing executor sleeping strategies.
Currently, it is not possible to run a Tokio reactor and a
`CurrentThread` executor on the same thread. The executor is
hard coded to use condvars for sleeping and the Tokio reactor
requires calling `epoll_wait` (or equivalent) for blocking the
current thread.
The `Sleep` trait is added to abstract over this sleeping strategy.
Beyond just supporting the Tokio reactor, adding a `Sleep` trait is
useful for integrating any logic that requires hooking into the sleep
strategy (e.g. timers).
`executor::CurrentThread` is then modified to accept a `Sleep` value
that allows specifying a custom sleep strategy.1 parent 3826530 commit a26e594
File tree
9 files changed
+463
-316
lines changed- benches
- src
- executor
- stream
- task_impl
- std
- tests
9 files changed
+463
-316
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
0 commit comments