Yayay! Was able to follow the instructions from the Async Book, and build my own Executor + Timer Future! This is *super* exciting stuff! https://github.com/yoshuawuyts/playground-async-book/blob/master/src/main.rs …
Haha, I got half the words you just said. What's a "hash-wheel timer"? I reckon having a single threaded executor would be a really fun project; probably v. useful for lots of WASM / Embedded / Testing contexts too!
-
-
It's a way to handle many thousands of concurrent timers.
@ifesdjeen's https://github.com/ifesdjeen/hashed-wheel-timer … has a README that includes a nice description. Divide desired delay by a minimum granularity, create N linked lists/trees, constant threads zip around popping lists & triggering events -
Heh, fun fact: turns out tokio-timer makes use of a hierarchical hashed wheel impl https://docs.rs/tokio-timer/0.2.7/src/tokio_timer/timer/mod.rs.html#97 …
End of conversation
New conversation -
-
-
Oh oh oh, and testing. Don't forget testing. Would love to see a "chaos executor" at some point that deterministically randomizes message ordering :D
-
Any system that handles events of some sort but can't be switched into a mode that lets you scramble concurrent (non-causally-related) events during testing is incomplete IMO. It's such a huge win for resilience of users's systems without forcing users to write complex tests.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.