jobflow
Do ordered jobs concurrently and easily. Designed to allow for arbitrary ordering of tasks and sending the output of a task into the input of another.
Jobs and Flows
A flow is composed of many jobs. Jobs are meant to be a form of atomic operations. The users
can create a job by giving it a name and assigning an Action to it. When using
Flow::create users can directly use any function of either signature FnOnce() -> R or FnOnce(T) -> R.
If using the former signature, attempting to set an input for this task will return an error.
Examples
No I/O
use Flow;
let mut flow = new;
flow.create;
flow.run.expect;
Accepts an input, returns an output
use ;
let mut flow = new;
let job = flow.input.flows_into
.unwrap.flows_into
.unwrap;
let output = flow.apply.unwrap;
assert_eq!;
Multiple tasks can flow into a single task
Multiple tasks can be used an input into a single task using a funnel. As long as the input
of the action is something that implements FromIterator<T> and IntoIterator<Item=T>
use ;
let mut flow = new;
let funnel = flow.create.funnelled.unwrap;
flow.create.flows_into.unwrap;
flow.create.flows_into.unwrap;
funnel.flows_into.expect;
let sum = flow.get.expect;
assert_eq!;