Commit fb77b407 authored by Shubhanshu Agrawal's avatar Shubhanshu Agrawal Committed by Facebook Github Bot

BatchDispatcher add() interface

Summary: converting add(value&&) to add(value) to make it easier for callsites to use.

Reviewed By: A5he

Differential Revision: D4000416

fbshipit-source-id: c66f4d93d1223286bbc786d17f65ed02a63cc794
parent 40e6161e
...@@ -75,7 +75,7 @@ class BatchDispatcher { ...@@ -75,7 +75,7 @@ class BatchDispatcher {
: executor_(executor), : executor_(executor),
state_(new DispatchState(std::move(dispatchFunc))) {} state_(new DispatchState(std::move(dispatchFunc))) {}
Future<ResultT> add(ValueT&& value) { Future<ResultT> add(ValueT value) {
if (state_->values.empty()) { if (state_->values.empty()) {
executor_.add([state = state_]() { dispatchFunctionWrapper(*state); }); executor_.add([state = state_]() { dispatchFunctionWrapper(*state); });
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment