Re:You might want async in your project
by conradludgate on Monday September 11, 2023 @05:20AM
(#37464738)
You either wait on the channel or wait on a read. How do you manage both?
[ Parent
| on HN ]
Re:You might want async in your project
by vc8f6vVV on Monday September 11, 2023 @05:48PM
(#37474178)
You wait on a shared channel so both read and sleep threads queue a message when ready (whichever comes first). Not sure about channels, but in other languages it would be a concurrent queue.
Re:You might want async in your project
by conradludgate on Monday September 11, 2023 @10:05PM
(#37476234)
This won't cancel the read, it'll just ignore the result