pending collector iterators

This commit is contained in:
JMARyA 2025-03-09 06:01:38 +01:00
parent 00e448ac31
commit b043db3f4e
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
4 changed files with 176 additions and 7 deletions

View file

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