diff options
author | Janna Golden <janna.golden@mongodb.com> | 2020-02-22 02:45:57 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2020-02-22 02:45:57 +0000 |
commit | b2d5432fdceaab0589fe6ca4eda24564515d58f9 (patch) | |
tree | d720f4ac3221d5d95b189f2ffa0d79a870082c09 /src/mongo/unittest | |
parent | 60aed37d906100af704bcb5c4cb8f6080e1540fe (diff) | |
download | mongo-b2d5432fdceaab0589fe6ca4eda24564515d58f9.tar.gz |
SERVER-44951 Expand TaskExecutor to implement exhaust functionality
Diffstat (limited to 'src/mongo/unittest')
-rw-r--r-- | src/mongo/unittest/task_executor_proxy.cpp | 12 | ||||
-rw-r--r-- | src/mongo/unittest/task_executor_proxy.h | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/mongo/unittest/task_executor_proxy.cpp b/src/mongo/unittest/task_executor_proxy.cpp index dd583c17056..911123d375c 100644 --- a/src/mongo/unittest/task_executor_proxy.cpp +++ b/src/mongo/unittest/task_executor_proxy.cpp @@ -106,6 +106,18 @@ StatusWith<executor::TaskExecutor::CallbackHandle> TaskExecutorProxy::scheduleRe return _executor->scheduleRemoteCommandOnAny(request, cb, baton); } +StatusWith<executor::TaskExecutor::CallbackHandle> +TaskExecutorProxy::scheduleExhaustRemoteCommandOnAny( + const executor::RemoteCommandRequestOnAny& request, + const RemoteCommandOnAnyCallbackFn& cb, + const BatonHandle& baton) { + return _executor->scheduleExhaustRemoteCommandOnAny(request, cb, baton); +} + +bool TaskExecutorProxy::hasTasks() { + return _executor->hasTasks(); +} + void TaskExecutorProxy::cancel(const CallbackHandle& cbHandle) { _executor->cancel(cbHandle); } diff --git a/src/mongo/unittest/task_executor_proxy.h b/src/mongo/unittest/task_executor_proxy.h index 3d37f837e81..fa27e0cde05 100644 --- a/src/mongo/unittest/task_executor_proxy.h +++ b/src/mongo/unittest/task_executor_proxy.h @@ -69,6 +69,11 @@ public: const executor::RemoteCommandRequestOnAny& request, const RemoteCommandOnAnyCallbackFn& cb, const BatonHandle& baton = nullptr) override; + StatusWith<CallbackHandle> scheduleExhaustRemoteCommandOnAny( + const executor::RemoteCommandRequestOnAny& request, + const RemoteCommandOnAnyCallbackFn& cb, + const BatonHandle& baton = nullptr) override; + bool hasTasks() override; void cancel(const CallbackHandle& cbHandle) override; void wait(const CallbackHandle& cbHandle, Interruptible* interruptible = Interruptible::notInterruptible()) override; |