Hacker News new | ask | show | jobs
by freshhawk 4303 days ago
I'm pretty sure that the alts! block is absolutely necessary otherwise you will deadlock after 10 files (your channel buffer size) because nothing else is taking from upload-chan or signing-chan.

Wouldn't a pipeline be a better solution to this? Taking and throwing away the values from a channel just to trigger a transducer that puts the value in another channel as a side effect is a strange way to do things.

Also a simple println test will show that the transducer function is triggered when you put on the channel rather than when you take.