proxygen
|
#include <Executor.h>
Classes | |
class | KeepAlive |
Public Member Functions | |
virtual | ~Executor () |
virtual void | add (Func)=0 |
virtual void | addWithPriority (Func, int8_t priority) |
virtual uint8_t | getNumPriorities () const |
Static Public Member Functions | |
template<typename ExecutorT > | |
static KeepAlive< ExecutorT > | getKeepAliveToken (ExecutorT *executor) |
template<typename ExecutorT > | |
static KeepAlive< ExecutorT > | getKeepAliveToken (ExecutorT &executor) |
Static Public Attributes | |
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 | |
virtual bool | keepAliveAcquire () |
virtual void | keepAliveRelease () |
Static Protected Member Functions | |
template<typename ExecutorT > | |
static bool | isKeepAliveDummy (const KeepAlive< ExecutorT > &keepAlive) |
template<typename ExecutorT > | |
static KeepAlive< ExecutorT > | makeKeepAlive (ExecutorT *executor) |
Static Private Member Functions | |
template<typename ExecutorT > | |
static KeepAlive< ExecutorT > | makeKeepAliveDummy (ExecutorT *executor) |
An Executor accepts units of work with add(), which should be threadsafe.
Definition at line 31 of file Executor.h.
|
inlinevirtual |
|
pure virtual |
Enqueue a function to executed by this executor. This and all variants must be threadsafe.
Implemented in folly::EventBase, folly::futures::detail::WaitExecutor, folly::futures::detail::DeferredExecutor, folly::fibers::FiberManager, folly::VirtualEventBase, folly::CPUThreadPoolExecutor, folly::SerialExecutor, folly::VirtualExecutor, folly::ThreadedExecutor, folly::ThreadPoolExecutor, folly::TimedDrivableExecutor, folly::IOThreadPoolExecutor, folly::DefaultKeepAliveExecutor::WeakRef, folly::ScopedEventBaseThread, ThrowingExecutor, folly::ManualExecutor, folly::FiberIOExecutor, folly::InlineExecutor, folly::python::AsyncioExecutor, folly::ScheduledExecutor, folly::python::GILAwareManualExecutor, folly::TestExecutor, folly::QueuedImmediateExecutor, and folly::KeepAliveTestExecutor.
Referenced by folly::SingletonVault::doEagerInitVia(), folly::isSequencedExecutor(), folly::fibers::ExecutorLoopController::schedule(), folly::fibers::ExecutorLoopController::scheduleThreadSafe(), and ~Executor().
Enqueue a function with a given priority, where 0 is the medium priority This is up to the implementation to enforce
Reimplemented in folly::CPUThreadPoolExecutor, folly::SerialExecutor, folly::VirtualExecutor, and folly::DefaultKeepAliveExecutor::WeakRef.
Definition at line 25 of file Executor.cpp.
Referenced by TEST(), and ~Executor().
|
inlinestatic |
Definition at line 138 of file Executor.h.
References folly::pushmi::executor, keepAliveAcquire(), and value.
Referenced by folly::SerialExecutor::add(), folly::SerialExecutor::addWithPriority(), folly::Executor::KeepAlive< folly::VirtualEventBase >::copy(), folly::SerialExecutor::createUnique(), getKeepAliveToken(), folly::getKeepAliveToken(), folly::isSequencedExecutor(), folly::VirtualEventBase::runInEventBaseThread(), folly::TEST(), and folly::VirtualExecutor::wrapFunc().
|
inlinestatic |
Definition at line 153 of file Executor.h.
References getKeepAliveToken(), and value.
|
inlinevirtual |
Reimplemented in PriorityExecutor, folly::CPUThreadPoolExecutor, folly::SerialExecutor, folly::DefaultKeepAliveExecutor::WeakRef, and folly::VirtualExecutor.
Definition at line 44 of file Executor.h.
|
inlinestaticprotected |
Returns true if the KeepAlive is constructed from an executor that does not support the keep alive ref-counting functionality
Definition at line 166 of file Executor.h.
References folly::Executor::KeepAlive< ExecutorT >::executorAndDummyFlag_, keepAliveAcquire(), and keepAliveRelease().
Referenced by folly::VirtualExecutor::VirtualExecutor().
|
protectedvirtual |
Reimplemented in folly::EventBase, folly::futures::detail::WaitExecutor, folly::futures::detail::DeferredExecutor, folly::DefaultKeepAliveExecutor, folly::VirtualEventBase, folly::SerialExecutor, folly::DefaultKeepAliveExecutor::WeakRef, folly::python::AsyncioExecutor, and folly::KeepAliveTestExecutor.
Definition at line 30 of file Executor.cpp.
Referenced by getKeepAliveToken(), and isKeepAliveDummy().
|
protectedvirtual |
Reimplemented in folly::EventBase, folly::futures::detail::WaitExecutor, folly::futures::detail::DeferredExecutor, folly::VirtualEventBase, folly::DefaultKeepAliveExecutor, folly::SerialExecutor, folly::DefaultKeepAliveExecutor::WeakRef, folly::python::AsyncioExecutor, and folly::KeepAliveTestExecutor.
Definition at line 34 of file Executor.cpp.
References folly::FATAL.
Referenced by isKeepAliveDummy().
|
inlinestaticprotected |
Definition at line 179 of file Executor.h.
References folly::pushmi::executor, and value.
Referenced by folly::DefaultKeepAliveExecutor::WeakRef::create(), and folly::DefaultKeepAliveExecutor::WeakRef::lock().
|
inlinestaticprivate |
Definition at line 188 of file Executor.h.
References folly::pushmi::executor, and value.
|
static |
Definition at line 50 of file Executor.h.
Referenced by TEST().
|
static |
Definition at line 48 of file Executor.h.
Referenced by folly::CPUThreadPoolExecutor::stopThreads(), and TEST().
|
static |
Definition at line 49 of file Executor.h.
Referenced by folly::PriorityLifoSemMPMCQueue< T, kBehavior >::add(), folly::Future< folly::folly::Unit >::Future(), folly::futures::map(), folly::SemiFuture< T >::SemiFuture(), and TEST().