✨ pending collector iterators
This commit is contained in:
parent
00e448ac31
commit
b043db3f4e
4 changed files with 176 additions and 7 deletions
12
src/lib.rs
12
src/lib.rs
|
@ -3,12 +3,23 @@ use std::{sync::mpsc, thread, time::Instant};
|
|||
pub mod job;
|
||||
pub mod service;
|
||||
pub use comrade_macro::worker;
|
||||
pub use crossbeam;
|
||||
use dashmap::DashMap;
|
||||
use once_cell::sync::Lazy;
|
||||
pub use serde_json;
|
||||
|
||||
// TODO : worker docs + refactor
|
||||
|
||||
// TODO : functions which can be stopped, paused, etc
|
||||
/*
|
||||
Example:
|
||||
|
||||
let myf = Function::new(|| do_something());
|
||||
|
||||
// stop fn
|
||||
myf.stop();
|
||||
*/
|
||||
|
||||
pub static UNION: Lazy<
|
||||
DashMap<&'static str, job::JobMultiplexer<serde_json::Value, serde_json::Value>>,
|
||||
> = Lazy::new(DashMap::new);
|
||||
|
@ -43,6 +54,7 @@ where
|
|||
let (fastest_item, fastest_result, elapsed) = rx.recv().unwrap();
|
||||
|
||||
for handle in handles {
|
||||
// todo : threads do not get killed here
|
||||
handle.thread().unpark();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue