Skip to main content

rumtk_pipeline_quick_run

Macro rumtk_pipeline_quick_run 

Source
macro_rules! rumtk_pipeline_quick_run {
    ( $($command:expr),+ ) => { ... };
}
Expand description

Given a series of RUMCommand passed to this macro, prepare and execute the commands in a pipeline. A pipeline here refers to the Unix style pipeline which is the terminal form of a pipeline. The pipeline behaves like it would in the terminal => ls | wc.

See this article and the Unix Philosophy to learn more!

§Example

§Simple

use rumtk_core::{rumtk_pipeline_command, rumtk_pipeline_quick_run, rumtk_resolve_task, rumtk_init_threads};
use rumtk_core::core::{RUMResult};
use rumtk_core::strings::RUMStringConversions;
use rumtk_core::types::RUMBuffer;

let f = async || -> RUMResult<()> {
    let result = rumtk_pipeline_quick_run!(
        rumtk_pipeline_command!("ls"),
        rumtk_pipeline_command!("wc")
    ).unwrap();

    assert_eq!(result.is_empty(), false, "Pipeline returned no buffer from command wc! => {:?}", &result);
    Ok(())
};

rumtk_resolve_task!(f()).unwrap();