Fork me on GitHub
#core-async
<
2021-08-22
>
wei17:08:10

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 []
  (aws.async/invoke
   lambda
   {:op :Invoke
    :ch (async/promise-chan (map :StatusCode))
    :request
    {:FunctionName "test"
     :Payload (json/write-str {:cmd "test"})}}))

hiredman17:08:00

Are you reading from the promise chan?

hiredman17:08:16

I guess it doesn't matter

hiredman17:08:33

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

wei17:08:49

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

hiredman17:08:04

With a promise chan you shouldn't need to

hiredman17:08:50

Hmmm, actually, I am not sure

hiredman17:08:50

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