News for hackers. Stuff that matters.
Re:Show HN: Ts-Chan – Go-Like Concurrency Primitives for Typ... by joeycumines on Wednesday November 08, 2023 @09:51AM (#38191138)
Actually, it was fun, so I've made it into an actual package.

The one I slapped together works, but this one is better (fixes issues with actually stopping it properly): https://github.com/joeycumines/generator-ticker

On NPM as generator-ticker.

Re:Show HN: Ts-Chan – Go-Like Concurrency Primitives for Typ... by eddtries on Wednesday November 08, 2023 @11:26AM (#38192697)
Thanks!
Re:Show HN: Ts-Chan – Go-Like Concurrency Primitives for Typ... by joeycumines on Wednesday November 08, 2023 @09:24PM (#38200278)
Addendum: My first attempt would drift over time, if the receiver was slow.

Hurt my head a little, but it's fixed now, and I'm at least moderately confident it's correct - unit tested the behavior step by step using `ts-chan`, actually. Will probably use that test as another example use case.