Welcome! Please see the About page for a little more info on how this works.

+1 vote
in core.async by

Question in slack about why a promise chan "returns the result of the promise every time you call".

The docstring in clj includes the phrase

Consumers will block until either a value is placed in the channel or the
channel is closed, then return the value (or nil) forever.

This is missing from the clojurescript version of the docstring:

Creates a promise channel with an optional transducer, and an optional
exception-handler. A promise channel can take exactly one value that consumers
will receive. Once full, puts complete but val is dropped (no transfer).
Consumers will block until either a value is placed in the channel or the
channel is closed. See chan for the semantics of xform and ex-handler.

source

1 Answer

+2 votes
by
selected by
 
Best answer

Thanks, an oversight. Fixed in core-async master now.

...