| Crates.io | barley-std |
| lib.rs | barley-std |
| version | 0.4.0 |
| created_at | 2023-06-05 10:54:36.787774+00 |
| updated_at | 2023-06-13 10:57:17.626257+00 |
| description | The Barley standard library |
| homepage | https://github.com/panthios/barley |
| repository | https://github.com/panthios/barley |
| max_upload_size | |
| id | 882984 |
| size | 34,630 |
barley-stdThis crate contains the standard library for the barley workflow engine. It provides a set of common actions that can be used in any script.
use barley_runtime::prelude::*;
use barley_std::thread::Sleep;
use std::time::Duration;
#[tokio::main]
async fn main() -> Result<(), ActionError> {
tracing_subscriber::fmt::init();
let sleep_1 = Sleep::new(Duration::from_secs(1));
let sleep_2 = Sleep::new(Duration::from_secs(2));
RuntimeBuilder::new()
.add_action(sleep_1.into()).await
.add_action(sleep_2.into()).await
.build()
.run()
.await
}