From: David Goode Date: Sat, 2 Dec 2017 03:56:14 +0000 (-0800) Subject: allow fiber executor to override fiber options X-Git-Tag: v2017.12.04.00~1 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=4bec077b3dc283e75125e9cf95fad89ca6617101;p=folly.git 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 --- 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