proxygen
folly::FiberIOExecutor Class Reference

An IOExecutor that executes funcs under mapped fiber context. More...

#include <FiberIOExecutor.h>

Inheritance diagram for folly::FiberIOExecutor:
folly::IOExecutor folly::Executor

Public Member Functions

 FiberIOExecutor (const std::shared_ptr< IOExecutor > &ioExecutor, fibers::FiberManager::Options opts=fibers::FiberManager::Options())
 
virtual void add (folly::Function< void()> f) override
 
virtual folly::EventBasegetEventBase () override
 
- Public Member Functions inherited from folly::IOExecutor
 ~IOExecutor () override=default
 
- Public Member Functions inherited from folly::Executor
virtual ~Executor ()
 
virtual void addWithPriority (Func, int8_t priority)
 
virtual uint8_t getNumPriorities () const
 

Private Attributes

std::shared_ptr< IOExecutorioExecutor_
 
fibers::FiberManager::Options options_
 

Additional Inherited Members

- Static Public Member Functions inherited from folly::Executor
template<typename ExecutorT >
static KeepAlive< ExecutorT > getKeepAliveToken (ExecutorT *executor)
 
template<typename ExecutorT >
static KeepAlive< ExecutorT > getKeepAliveToken (ExecutorT &executor)
 
- Static Public Attributes inherited from folly::Executor
static const int8_t LO_PRI = SCHAR_MIN
 
static const int8_t MID_PRI = 0
 
static const int8_t HI_PRI = SCHAR_MAX
 
- Protected Member Functions inherited from folly::Executor
virtual bool keepAliveAcquire ()
 
virtual void keepAliveRelease ()
 
- Static Protected Member Functions inherited from folly::Executor
template<typename ExecutorT >
static bool isKeepAliveDummy (const KeepAlive< ExecutorT > &keepAlive)
 
template<typename ExecutorT >
static KeepAlive< ExecutorT > makeKeepAlive (ExecutorT *executor)
 

Detailed Description

An IOExecutor that executes funcs under mapped fiber context.

A FiberIOExecutor wraps an IOExecutor, but executes funcs on the FiberManager mapped to the underlying IOExector's event base.

Definition at line 31 of file FiberIOExecutor.h.

Constructor & Destructor Documentation

folly::FiberIOExecutor::FiberIOExecutor ( const std::shared_ptr< IOExecutor > &  ioExecutor,
fibers::FiberManager::Options  opts = fibers::FiberManager::Options() 
)
inlineexplicit

Definition at line 33 of file FiberIOExecutor.h.

36  : ioExecutor_(ioExecutor), options_(std::move(opts)) {}
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
fibers::FiberManager::Options options_
std::shared_ptr< IOExecutor > ioExecutor_

Member Function Documentation

virtual void folly::FiberIOExecutor::add ( folly::Function< void()>  )
inlineoverridevirtual

Enqueue a function to executed by this executor. This and all variants must be threadsafe.

Implements folly::Executor.

Definition at line 38 of file FiberIOExecutor.h.

References folly::fibers::FiberManager::add(), f, folly::fibers::getFiberManager(), ioExecutor_, folly::gen::move, and options_.

38  {
39  auto eventBase = ioExecutor_->getEventBase();
41  }
auto f
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
fibers::FiberManager::Options options_
void add(folly::Func f) override
std::shared_ptr< IOExecutor > ioExecutor_
FiberManager & getFiberManager(EventBase &evb, const FiberManager::Options &opts)
virtual folly::EventBase* folly::FiberIOExecutor::getEventBase ( )
inlineoverridevirtual

Implements folly::IOExecutor.

Definition at line 43 of file FiberIOExecutor.h.

References ioExecutor_.

43  {
44  return ioExecutor_->getEventBase();
45  }
std::shared_ptr< IOExecutor > ioExecutor_

Member Data Documentation

std::shared_ptr<IOExecutor> folly::FiberIOExecutor::ioExecutor_
private

Definition at line 48 of file FiberIOExecutor.h.

Referenced by add(), and getEventBase().

fibers::FiberManager::Options folly::FiberIOExecutor::options_
private

Definition at line 49 of file FiberIOExecutor.h.

Referenced by add().


The documentation for this class was generated from the following file: