Commit 8d0aa1a
committed
futures: Service abstraction
## Description
An abstraction for coordinating the lifecycle of tokio tasks, looking
after:
- Building up services by adding tasks or through composition.
- Waiting for multiple tasks to complete.
- Running secondary tasks that need to be wound down when the service
winds down, but otherwise don't affect the lifecycle of the service
(the service doesn't wait for these tasks to complete to shutdown).
- Graceful shutdown, with a grace period, because the service has
wrapped up, or because of a termination request, or an error.
- Panic unwinding.
- Cascading termination (errors from multiple components, multiple
termination requests, timeout during shutdown).
- Signal handling from the operating system.
## Test plan
New unit tests:
```
sui-futures$ cargo nextest run -- service
```1 parent 62adaa2 commit 8d0aa1a
File tree
4 files changed
+738
-1
lines changed- crates/sui-futures
- src
4 files changed
+738
-1
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | | - | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
0 commit comments