#promise #thread-pool #adaptive #abyss #resolve #duration #sleep

abyss-promise

[abyss] A simple promise implementation with adaptive threadpool support

3 unstable releases

0.2.0 Feb 5, 2022
0.1.1 Dec 16, 2021
0.1.0 Dec 16, 2021

#966 in Concurrency

Download history 23/week @ 2024-02-18 22/week @ 2024-02-25 3/week @ 2024-03-03 5/week @ 2024-03-10

53 downloads per month

MIT/Apache

14KB
305 lines

This is a simple promise implementation with an adaptive threadpool.

Usage:

use abyss_promise::Promise;

let promise = Promise::new(|promise| {
    std::thread::sleep(std::time::Duration::from_millis(100));
    promise.resolve(0);
});

assert_eq!(promise.resolve(), Some(0));

Dependencies

~0.8–7MB
~19K SLoC