Commit 4bec077b authored by David Goode's avatar David Goode Committed by Facebook Github Bot

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
parent 20272b4e
......@@ -30,12 +30,14 @@ namespace folly {
*/
class FiberIOExecutor : public IOExecutor {
public:
explicit FiberIOExecutor(const std::shared_ptr<IOExecutor>& ioExecutor)
: ioExecutor_(ioExecutor) {}
explicit FiberIOExecutor(
const std::shared_ptr<IOExecutor>& ioExecutor,
fibers::FiberManager::Options opts = fibers::FiberManager::Options())
: ioExecutor_(ioExecutor), options_(std::move(opts)) {}
virtual void add(folly::Function<void()> 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> ioExecutor_;
fibers::FiberManager::Options options_;
};
} // namespace folly
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