mirror of
https://github.com/nukesor/pueue
synced 2024-09-30 13:03:36 +00:00
Stop using recv_timeout for now
This commit is contained in:
parent
506234dc1a
commit
ef634bda3c
|
@ -40,14 +40,12 @@ impl TaskHandler {
|
|||
/// 2. Check whether any tasks just finished
|
||||
/// 3. Check whether we can spawn new tasks
|
||||
pub fn run(&mut self) {
|
||||
let timeout = Duration::from_millis(250);
|
||||
loop {
|
||||
self.receive_commands();
|
||||
self.process_finished();
|
||||
if self.is_running {
|
||||
let _res = self.check_new();
|
||||
}
|
||||
std::thread::sleep(timeout);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,8 +97,12 @@ impl TaskHandler {
|
|||
}
|
||||
|
||||
fn receive_commands(&mut self) {
|
||||
let timeout = Duration::from_millis(250);
|
||||
match self.receiver.recv_timeout(timeout) {
|
||||
let timeout = Duration::from_millis(100);
|
||||
// Don't use recv_timeout for now, until this bug get's fixed
|
||||
// https://github.com/rust-lang/rust/issues/39364
|
||||
//match self.receiver.recv_timeout(timeout) {
|
||||
std::thread::sleep(timeout);
|
||||
match self.receiver.try_recv() {
|
||||
Ok(message) => info!("{:?}", message),
|
||||
Err(_) => {},
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue