-
Notifications
You must be signed in to change notification settings - Fork 12
feat: introduce seatbelt crate #203
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #203 +/- ##
========================================
- Coverage 100.0% 99.0% -1.0%
========================================
Files 106 135 +29
Lines 6845 8174 +1329
========================================
+ Hits 6845 8093 +1248
- Misses 0 81 +81 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
| typeid = { version = "1.0.3", default-features = false } | ||
| windows-sys = { version = "0.61.2", default-features = false } | ||
| xxhash-rust = { version = "0.8.15", default-features = false } | ||
| fastrand = { version = "2.3.0", default-features = false, features = ["std"] } |
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.
Shoudl not have a feature specified here, do it in the crate's Cargo.toml. Same for http below.
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.
Also, keep the dependencies sorted.
|
|
||
| [package] | ||
| name = "seatbelt" | ||
| description = "Resilience and recovery mechanisms for services, applications, and libraries." |
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.
How about
"Resilience and recovery mechanisms for fallible operations.
| description = "Resilience and recovery mechanisms for services, applications, and libraries." | ||
| version = "0.1.0" | ||
| readme = "README.md" | ||
| keywords = ["oxidizer", "resilience", "tower", "recovery", "retry", "circuit-breaker"] |
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 "tower" be replaced with "layered"?
| reason = "Too ugly to make 'live links' possible with the combination of features" | ||
| )] | ||
|
|
||
| //! Resilience and fault handling for applications and libraries. |
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.
Match the description in Cargo.toml and in the top-level README.md
|
|
||
| //! Resilience and fault handling for applications and libraries. | ||
| //! | ||
| //! This crate helps applications handle transient faults gracefully through composable |
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.
| //! This crate helps applications handle transient faults gracefully through composable | |
| //! This crate helps you handle transient faults gracefully through composable |
| //! | ||
| //! - `options`: Enables common APIs for building resilience middleware, including [`SeatbeltOptions`]. | ||
| //! Requires [`tick`] for timing operations. | ||
| //! - `service`: Re-exports common types for building middleware from [`layered`] crate. |
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.
How about calling this feature "layered"?
|
|
||
| /// Re-exported types from the [`layered`] crate. | ||
| #[cfg(any(feature = "service", test))] | ||
| pub mod service { |
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.
Always maybe call this module layered?
| /// | ||
| /// The default attempt has: | ||
| /// - `attempt`: 0 (first attempt, 0-based indexing) | ||
| /// - `is_last`: true (indicating this is both the first and last attempt) |
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.
What? Why is is_last true for the first attempt?
| /// > `layered` and reference it here instead of diverging. | ||
| #[derive(Debug)] | ||
| #[non_exhaustive] | ||
| pub struct SeatbeltOptions<In, Out> { |
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 worry that this is not serializable. Ultimately, I think we want Seatbelt to be configurable through JSON at the top. So I think we want to separate "options state" from things like Clock which is a runtime construct.
still WIP