barley-std

Crates.iobarley-std
lib.rsbarley-std
version0.4.0
sourcesrc
created_at2023-06-05 10:54:36.787774
updated_at2023-06-13 10:57:17.626257
descriptionThe Barley standard library
homepagehttps://github.com/panthios/barley
repositoryhttps://github.com/panthios/barley
max_upload_size
id882984
size34,630
Carlos Kieliszewski (carlosskii)

documentation

https://docs.rs/barley-std

README

barley-std

This crate contains the standard library for the barley workflow engine. It provides a set of common actions that can be used in any script.

Usage

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
}
Commit count: 123

cargo fmt