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
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.