From 4bec077b3dc283e75125e9cf95fad89ca6617101 Mon Sep 17 00:00:00 2001 From: David Goode Date: Fri, 1 Dec 2017 19:56:14 -0800 Subject: [PATCH] allow fiber executor to override fiber options Summary: As in title, for eg larger stack size Reviewed By: yfeldblum Differential Revision: D6466762 fbshipit-source-id: 303e8732c8bfb64fbd8619163779942fe5f8b5a8 --- folly/executors/FiberIOExecutor.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/folly/executors/FiberIOExecutor.h b/folly/executors/FiberIOExecutor.h index 18c36181..240d7d47 100644 --- a/folly/executors/FiberIOExecutor.h +++ b/folly/executors/FiberIOExecutor.h @@ -30,12 +30,14 @@ namespace folly { */ class FiberIOExecutor : public IOExecutor { public: - explicit FiberIOExecutor(const std::shared_ptr& ioExecutor) - : ioExecutor_(ioExecutor) {} + explicit FiberIOExecutor( + const std::shared_ptr& ioExecutor, + fibers::FiberManager::Options opts = fibers::FiberManager::Options()) + : ioExecutor_(ioExecutor), options_(std::move(opts)) {} virtual void add(folly::Function f) override { auto eventBase = ioExecutor_->getEventBase(); - folly::fibers::getFiberManager(*eventBase).add(std::move(f)); + folly::fibers::getFiberManager(*eventBase, options_).add(std::move(f)); } virtual folly::EventBase* getEventBase() override { @@ -44,6 +46,7 @@ class FiberIOExecutor : public IOExecutor { private: std::shared_ptr ioExecutor_; + fibers::FiberManager::Options options_; }; } // namespace folly -- 2.34.1