-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat(jstzd): define Task trait #563
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Continue to review full report in Codecov by Sentry.
|
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.
Lgtm, minor nits 🪡
Cargo.toml
Outdated
"crates/octez", | ||
"crates/jstzd" |
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.
Nit: Alphabetical ordering
"crates/octez", | |
"crates/jstzd" | |
"crates/jstzd" | |
"crates/octez", |
crates/jstzd/Cargo.toml
Outdated
async-dropper = { version = "0.3.1", features = ["tokio", "simple"] } | ||
async-trait = "0.1.82" | ||
futures-util.workspace = true | ||
async-scoped = "0.9.0" |
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.
Nit: Move dependencies to workspace Cargo
crates/jstzd/src/task/mod.rs
Outdated
#[async_trait] | ||
trait Task { | ||
type Config; | ||
async fn spawn(config: Self::Config) -> anyhow::Result<Self> |
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.
Lets just use anyhow::Result
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.
Lgtm
b21a887
to
7aae0bb
Compare
Context
Define the Task trait. Task represents any task to be run with backends, e.g. octez node, jstz node, etc.
JSTZ-115
Description
Define the basic
Task
trait.The methods:
spawn
: The initialiser that takes in the necessary config for this task and runs the task.kill
: Abort the running task.health_check
: Check if the task is still alive.Manually testing the PR
cargo build