batched-fn
batched-fn copied to clipboard
how does this map between request source and response?
If I have 2 concurrent requesters which are batched together, how does this know which response to send to which requester?
doesn't seem to work correctly
![image](https://user-images.githubusercontent.com/2404795/147089232-00bc4f11-e44e-4373-b384-6e997e50e099.png)
The handler function must return the results in the same order of the corresponding inputs.
In particular, when a new input is received, evaluate_in_batch()
is called, which creates a new channel and then sends the input and the sender to the background batch worker through that new channel. When the batch worker finishes processing a batch, it collects the outputs and the corresponding senders and sends the output back through that new channel. That's where the order of the results matters.