code-reviews

dazld 2018-10-24T19:00:15.000100Z

any suggestions how to guard against that? thanks too

dazld 2018-10-24T19:00:57.000100Z

I guess I could not expose the in channel..

2018-10-24T19:01:44.000100Z

you should check the return value on every channel read and channel write, and have a graceful exit or recovery for nil

👍 1
2018-10-24T19:02:32.000100Z

this also means you don't necessarily need a sentinel value for early exit - you can just document that closing the in channel means you wrap things up

dazld 2018-10-24T19:02:44.000100Z

nice

2018-10-24T19:03:32.000100Z

if you study the functions in clojure.core.async, they follow that pattern: closing a channel they use is accepted as a way to make them exit if apropriate

dazld 2018-10-24T19:04:05.000100Z

that's a great idea, will do

dazld 2018-10-24T19:05:08.000100Z

this code lives in a component, so was thinking of something to shut it down

dazld 2018-10-24T19:05:29.000100Z

should I do any other cleanup?

dazld 2018-10-24T19:05:45.000100Z

draining any values I suppose

2018-10-24T19:14:09.000200Z

that depends on your domain, letting the channels go out of scope should suffice to release resources

👍 1