I'm trying to figure out how to batch incoming requests, do an action with the values in those requests, and then return the result of that action to each request. A slightly simplified version of my problem looks like the following:
Incoming requests make calls to
(defn process
[values]
;; put values on the queue and wait for result, then return the result
...)
Periodically, another function is called
(defn batch-process
[]
;; take up to 10 of the values from the queue, sum those values,
;; then return the result to their process requests
...)
I think I am lacking the vocabulary to figure out how I should be doing this. Any advice or pointers would be appreciated!