Crates.io | ice-threads |
lib.rs | ice-threads |
version | 0.1.0 |
source | src |
created_at | 2019-02-06 08:52:42.388469 |
updated_at | 2019-02-10 16:42:01.79686 |
description | Lightweight Thread pool implementation. |
homepage | |
repository | https://github.com/purple-ice/ice-threads |
max_upload_size | |
id | 113044 |
size | 13,836 |
ice-threads is a lightweight Thread Pool (Melter) implementation.
User can enqueue Tasks (Ice) to be executed.
Optionally, user can return a value that can be collected through a special handle (Bottle) that is returned by the thread pool task enqueuing method.
Tasks are put into the queue and eventually picked up by a task stealing thread (Heater) and executed.
Put this in your Cargo.toml
:
[dependencies]
ice-threads = "0.1"
Start melting your tasks:
use ice_threads::Melter;
fn main() {
let melter = Melter::new(1);
let s = melter.melt(|| {
"Watch this task melt away!"
}).open();
println!("{}", s);
}
Melter
type (Thread Pool)Bottle
type ("Future")