AvisoNovate / rook

Smart namespace-driven routing for Pedestal
http://rook.readthedocs.io/en/latest/index.html
Apache License 2.0
75 stars 11 forks source link

Replace "magic false" with close! in rook.async #12

Closed michalmarczyk closed 10 years ago

michalmarczyk commented 10 years ago

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.

hlship commented 10 years ago

I think this may be a terrific idea, and more properly follows the spirit of core.async.

hlship commented 10 years ago

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.

michalmarczyk commented 10 years ago

Cool!

A nil return from the body of go / thread results in the result channel being closed -- no special handling required.

hlship commented 10 years ago

Looked at the source, the thread macro already does this automatically. It's not documented.

hlship commented 10 years ago

I don't know that go behaves this way, but yes thread does; also http://dev.clojure.org/jira/browse/ASYNC-70

michalmarczyk commented 10 years ago

Both thread and go do this by design. I suppose the docstrings should mention this.