riker-rs / riker

Easily build efficient, highly concurrent and resilient applications. An Actor Framework for Rust.
https://riker.rs
MIT License
1.01k stars 71 forks source link

Feature/dynamic timer parking #174

Closed milgner closed 2 years ago

milgner commented 2 years ago

Instead of having the timer processing thread sleep for a fixed interval before checking for any jobs due, use the thread parking mechanism to park it until the next iteration. Any incoming commands to the time will unpark the thread to process the message in the channel.

I also added a mechanism to stop the timer thread when the actor system is shut down.