tasc is an asynchrounous worker pool library, allowing you to distribute work between multiple workers in both an asyncrhronous, and blocking API.
tasc aims to be simpistic and portable, the base API does not rely on running within a context that provides the standard library, and can be run in a bare metal environments.
The API aims to be very similar to that of [std::thread], so that if you understand one then understanding the other is simple.
tasc operates, by default, with a global context which relies on the standard library. The helper functions tasc::task, tasc::scope and everything under tasc::blocking will use the global context by default, and requires the global feature to be enables. When the global feature is enabled, it requires enabling the std feature which will require a dependency on the standard library.
Using Async tasc
async
Using The Context Directly
tasc allows you to create your own context by deriving the [TaskContext] trait on a type, and then passing that to [TaskBuilder]. If the std feature is enabled, tasc will provide such a context already called [StdContext]. Using [StdContext] outside of the global context is quite simple.
async
Scoped Tasks
tasc allows for scoped tasks, which are quite similar to scoped threads in the standard library, except it does not have the scope function.
async
Using The Blocking API
tasc does not force using asynchronous code, and provides a blocking alternative such as task::blocking::task and task::blocking::scope.
let handle0 = task;
let bar = 5;
let handle1 = scope;
let sum = handle.wait.unwrap + handle1.wait.unwrap;
println!;