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 …
-
Show this thread
-
Got a timer future working that waits 2 seconds, and then resumes!pic.twitter.com/t8pfMpViq3
2 replies 0 retweets 5 likesShow this thread -
Replying to @yoshuawuyts
I'd love to see an async book section on how to implement a hashed-wheel timer with a single thread to avoid dynamic thread spawn panics
1 reply 0 retweets 0 likes -
Replying to @sadisticsystems
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!
2 replies 0 retweets 0 likes -
Replying to @yoshuawuyts
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 events3 replies 0 retweets 3 likes
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 …
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.