-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
2,426 additions
and
2,021 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
- Search for all TODOs in code | ||
- Port over documentation | ||
- Port over tests | ||
|
||
|
||
|
||
|
||
|
||
|
||
Done: | ||
|
||
- Name | ||
- Error handling | ||
|
||
- SubsystemBuilder (or PreparedSubsystem, or something similar)! | ||
- Allows creating subsystems: | ||
- from FnOnce (non-restartable) | ||
- from Fn (restartable) | ||
- from `trait Subsystem` | ||
- from `trait RestartableSubsystem` | ||
- maybe gets passed directly into `start` | ||
|
||
- Solution to the entire "restartable subsystems" problem: | ||
- Make single subsystems awaitable! (Through the object returned from `start`) | ||
- Restart is then trivial to implement. | ||
- Make subsystem "Shutdown on Error/Panic" | ||
- Start/await it in a loop in the parent subsystem | ||
|
||
- Error generic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
need: | ||
- function that runs on all exit paths of the subsystem | ||
- that also has access to the locked parent, to remove itself from the list of children | ||
- is list of children really important? | ||
- atomic counter could work | ||
- but what about error propagation? | ||
|
||
- error propagation maybe not necessary. | ||
- register closure that will be executed on error/shutdown of the child | ||
- every subsystem can have 'shutdown triggers' attached to it | ||
|
||
fixed facts: | ||
- subsystems will never change their parent | ||
|
||
Suggestions: | ||
Subsystem have **no** reference to their parents. | ||
They | ||
- Use `joiner_tokens` for awaiting children | ||
- Use `cancellation_token` for shutdown | ||
- Simply 'drop' a subsystem to hard cancel an entire tree | ||
|
||
Open question: How to propagate errors? | ||
- Not at all? (Do we need error propagation?) | ||
- Through the joiner_tokens? | ||
If through the joiner_tokens: | ||
- Have `none`/`some(vec)` in every joiner_token for collecting errors | ||
- While walking up, put the error in the first available location | ||
- When dropping the token, propagate errors up if unconsumed | ||
- Uncaught errors simply get printed | ||
This should provide a quite natural way of propagating/dropping errors, | ||
and should work well with partial shutdown. | ||
|
||
Open question: How to deal with errors? | ||
- Every spawned subsystem can register functions that handle errors of their children | ||
- Possibilities are: | ||
- pass further up | ||
- Ignore | ||
- shutdown self and children | ||
- Probably a mechanism that will be inside of the joiner_token | ||
|
||
Open question: Ownership? | ||
- Parents should own children | ||
- But: HOW do children remove themselves from the parent once they are finished? | ||
- IMPORTANT QUESTION this is. Might be the one stone that breaks this construct. | ||
- The solution *might* be: The joiner_token removes them. That way, there is no recursive dependency. | ||
- Might need a fancy data structure that allows efficient RAII based object tracking | ||
- solved! (?) | ||
-> Implemented in remote_drop_collection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.