ice-threads

Crates.ioice-threads
lib.rsice-threads
version0.1.0
sourcesrc
created_at2019-02-06 08:52:42.388469
updated_at2019-02-10 16:42:01.79686
descriptionLightweight Thread pool implementation.
homepage
repositoryhttps://github.com/purple-ice/ice-threads
max_upload_size
id113044
size13,836
(purple-ice)

documentation

README

ice-threads

travis-ci.com crates.io docs.rs license

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.

Usage

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);
}

Features

  • Very simple to use.
  • Very light crate with no dependencies.

Changelog

v0.1.0

  • Introduced Melter type (Thread Pool)
  • Introduced Bottle type ("Future")
Commit count: 0

cargo fmt