-
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
1 parent
1475a6a
commit 7aae0bb
Showing
5 changed files
with
116 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,13 @@ | ||
[package] | ||
name = "jstzd" | ||
authors.workspace = true | ||
version.workspace = true | ||
edition.workspace = true | ||
repository.workspace = true | ||
|
||
[dependencies] | ||
anyhow.workspace = true | ||
tokio.workspace = true | ||
async-dropper.workspace = true | ||
async-trait.workspace = true | ||
futures-util.workspace = true |
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 @@ | ||
pub mod task; |
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,16 @@ | ||
use anyhow::Result; | ||
use async_trait::async_trait; | ||
|
||
#[async_trait] | ||
pub trait Task: Sized { | ||
type Config; | ||
|
||
/// Spins up the task with the given config. | ||
async fn spawn(config: Self::Config) -> Result<Self>; | ||
|
||
/// Aborts the running task. | ||
async fn kill(&mut self) -> Result<()>; | ||
|
||
/// Conducts a health check on the running task. | ||
async fn health_check(&self) -> Result<bool>; | ||
} |