Async init #6
Generated
+1903
File diff suppressed because it is too large
Load Diff
@@ -5,3 +5,10 @@ rust-version = "1.96"
|
|||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
tokio = { version = "1.52.3", features = ["full"] }
|
||||||
|
futures = { version = "0.3.32" }
|
||||||
|
reqwest = { version = "0.13.4", features = ["json", "stream", "multipart"] }
|
||||||
|
serde = { version = "1.0.228", features = ["derive"] }
|
||||||
|
serde_json = { version = "1.0.150" }
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
|||||||
+9
-2
@@ -1,3 +1,10 @@
|
|||||||
fn main() {
|
// TODO: Move this somewhere else
|
||||||
println!("Hello, world!");
|
pub const SECONDS_TO_SLEEP: u64 = 5;
|
||||||
|
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
loop {
|
||||||
|
println!("Do some work");
|
||||||
|
tokio::time::sleep(tokio::time::Duration::from_secs(SECONDS_TO_SLEEP)).await;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user