Creates an AtomicBatchDispatcher that uses the given dispatch function.
Declared in <folly/fibers/AtomicBatchDispatcher.h>
template<
typename InputT,
typename ResultT>
AtomicBatchDispatcher<InputT, ResultT>
createAtomicBatchDispatcher(
folly::Function<std::vector<ResultT>(std::vector<InputT>&&)> dispatchFunc,
size_t initialCapacity = 0);
initialCapacity is a hint about the number of inputs to expect:
It is used purely to reserve space for storing vector of inputs etc., so that reeallocation and move copy are reduced / not needed.
It is provided purely for performance reasons
A new AtomicBatchDispatcher using dispatchFunc.
| Name | Description |
|---|---|
| dispatchFunc | The function that processes the batch of inputs. |
| initialCapacity | Hint for the number of inputs to reserve space for. |