-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bottomless2 boilerplate #1386
bottomless2 boilerplate #1386
Conversation
4be3a7e
to
d0eafc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments but overall LGTM
@@ -0,0 +1,179 @@ | |||
#![allow(dead_code, unused_variables, async_fn_in_trait)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats up with the async fn in trait stuff? Probably complaining about the send issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linter complains because the trait is public API
// job panicked. report and exit process. The program is crippled, from | ||
// now on, so we just exit, and hope to restart on a fresh state. | ||
tracing::error!("fatal error: bottomless job panicked: {e}"); | ||
std::process::exit(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we make this choice at a higher layer? Seems a bit extreme here to abort the whole process at a layer this deep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's hard to trust higher level to abort the process if this task panics. The invariant here is that the task is not allowed to panic. it can error, but not panic. There's nothing much that the higher layer can do, the program is busted at this point. BTW, this is what assert
should do: if you fail an assertion you exit the program.
max_frame_no: u64, | ||
} | ||
|
||
pub trait Storage: Send + Sync { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use https://docs.rs/trait-variant/0.1.2/trait_variant/ to make the async fn sendable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'll see it's that's necessary later
d0eafc2
to
00ba1ba
Compare
No description provided.