Fork me on GitHub

not sure if this is a core.async question, but figured I'd try here. I have this function puts the result of an AWS invocation on a new promise channel. but if I call this function 10,000 times I only see about a few hundred invocations. are there any gotchas with this way of using channels, or should I look somewhere else for the issue?

(defn run-lambda []
   {:op :Invoke
    :ch (async/promise-chan (map :StatusCode))
    {:FunctionName "test"
     :Payload (json/write-str {:cmd "test"})}}))


Are you reading from the promise chan?


I guess it doesn't matter


There is a built in limit to how many pending operations a single channel can have, but that is for a single channel and it sounds like you are involve multiple channels


hmm ok thanks. could be I'm getting throttled somewhere else then. just wanted to make sure I wasn't using it incorrectly, e.g. need to take from the channel in order for the invocation to happen


With a promise chan you shouldn't need to


Hmmm, actually, I am not sure


I was thinking a promise channel behaves like a (chan 1) in that the producer can just write the result and move on, without waiting for a consumer, but I am not actually sure if it does that or not, or of the first producer still has to wait for at least one consumer

Jan K20:08:26

promise-chan never blocks on puts