Choir

Crates.io Docs.rs Build Status MSRV codecov.io

Choir is a task orchestration framework. It helps you to organize all the CPU workflow in terms of tasks.

Principles are simple: no unsafe code, and minimize any locking in order to scale well.

Example:

rust let task1 = choir.run_task(|| { println!("foo"); }); let task2 = choir.idle_task(|| { println!("bar"); }); task2.depend_on(&task1); task2.run();

Selling Pitch

What makes Choir elegant? Generally when we need to encode the semantics of "wait for dependencies", we think of some sort of a counter. Maybe an atomic, for the dependency number. When it reaches zero (or one), we schedule a task for execution. In Choir, the internal data for a task (i.e. the functor itself!) is placed in an Arc. Whenever we are able to extract it from the Arc (which means there are no other dependencies), we move it to a scheduling queue. I think Rust type system shows its best here.

You can add or remove workers at any time to balance the system load that may be running other applications at the same time.

TODO: