barley-interface

A runtime interface for Barley

4 releases (breaking)

0.3.0 Jun 5, 2023
0.2.0 May 25, 2023
0.1.0 May 23, 2023
0.0.1 May 17, 2023

22 downloads per month

MIT/Apache

28KB
507 lines

barley-interface

This crate provides a basic command-line interface for the barley workflow engine. It provides runtime progress and error reporting.

This crate does not provide any interactive features, as that would defeat the purpose of Barley entirely. It is simply a wrapper around the base Context that provides more information at runtime.

Usage

use barley_interface::Interface;
use barley_runtime::*;
use barley_std::thread::Sleep;
use std::time::Duration;

#[tokio::main]
async fn main() -> Result<()> {
  let interface = Interface::new();
  let sleep = Sleep::new(Duration::from_secs(1));

  interface.add_action(sleep).await;

  interface.run().await
}

lib.rs:

barley-interface

This crate provides a simple CLI interface for the barley workflow engine. It should be used instead of the Context struct from the barley-runtime crate, since it provides debug callbacks for progress tracking.

Dependencies

~3–12MB
~126K SLoC