Fork me on GitHub
#code-reviews
<
2018-10-24
>
dazld19:10:15

any suggestions how to guard against that? thanks too

dazld19:10:57

I guess I could not expose the in channel..

noisesmith19:10:44

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

👍 4
noisesmith19:10:32

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

noisesmith19:10:32

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

dazld19:10:05

that's a great idea, will do

dazld19:10:08

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

dazld19:10:29

should I do any other cleanup?

dazld19:10:45

draining any values I suppose

noisesmith19:10:09

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

👍 4