[][src]Crate blackhole

Blackhole

...to throw your threads into.

Project

Features

  • Simple thread manager.
  • Threads' panics are printed to stderr.
  • TODO

Design

It uses a channel and 2 threads:

  • Manager: holds jobs in a queue.
  • Runner: constantly contacts manager to ask for new jobs to run.

Examples

use blackhole::Blackhole;

let active_limit: u64 = 10;
let queue_limit: usize = 1_000;
let blackhole = Blackhole::new(active_limit, queue_limit).unwrap();
for i in 0..20 {
    blackhole.throw(move || {
        println!("i = {:02}", i);
    });
}
blackhole.escape_on_idle().unwrap();

Structs

Blackhole

Blackhole

Constants

CODE_NAME

Crate code name

NAME

Crate name

RELEASE_DATE

Crate release date (year/month/day)

TAG

Tag, which can be used for logging...

UUID

Unique universally identifier of this crate

VERSION

Crate version