Closed michalmarczyk closed 10 years ago
I think this may be a terrific idea, and more properly follows the spirit of core.async.
I'm just doing a little touch-up for the case of an sync handler that returns nil; have to gimmick things so that the channel is closed.
Cool!
A nil
return from the body of go
/ thread
results in the result channel being closed -- no special handling required.
Looked at the source, the thread macro already does this automatically. It's not documented.
I don't know that go
behaves this way, but yes thread
does; also http://dev.clojure.org/jira/browse/ASYNC-70
Both thread
and go
do this by design. I suppose the docstrings should mention this.
Sending this in right away so that it's there in the issue tracker, though I suppose we may want to test/benchmark more extensively in case there are any unexpected issues.