proxygen
|
#include <TimedDrivableExecutor.h>
Public Member Functions | |
~TimedDrivableExecutor () noexcept | |
void | drive () noexceptoverride |
Implements DrivableExecutor. More... | |
bool | try_drive () noexcept |
template<typename Rep , typename Period > | |
bool | try_drive_for (const std::chrono::duration< Rep, Period > &timeout) noexcept |
template<typename Clock , typename Duration > | |
bool | try_drive_until (const std::chrono::time_point< Clock, Duration > &deadline) noexcept |
void | add (Func) override |
size_t | run () noexcept |
size_t | drain () noexcept |
void | wait () noexcept |
Wait for work to do. More... | |
bool | try_wait () noexcept |
template<typename Rep , typename Period > | |
bool | try_wait_for (const std::chrono::duration< Rep, Period > &timeout) noexcept |
Wait for work to do or for a period of timeout, whichever is sooner. More... | |
template<typename Clock , typename Duration > | |
bool | try_wait_until (const std::chrono::time_point< Clock, Duration > &deadline) noexcept |
Wait for work to do or until deadline passes, whichever is sooner. More... | |
Public Member Functions inherited from folly::DrivableExecutor | |
~DrivableExecutor () 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 | |
UMPSCQueue< Func, true > | queue_ |
Func | func_ |
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) |
Definition at line 30 of file TimedDrivableExecutor.h.
|
inlinenoexcept |
Definition at line 32 of file TimedDrivableExecutor.h.
References drain(), drive(), and folly::pushmi::__adl::noexcept().
|
overridevirtual |
Enqueue a function to executed by this executor. This and all variants must be threadsafe.
Implements folly::Executor.
Definition at line 26 of file TimedDrivableExecutor.cpp.
References folly::gen::move, and queue_.
Referenced by TEST(), and try_drive_until().
|
noexcept |
Definition at line 55 of file TimedDrivableExecutor.cpp.
References run().
Referenced by TEST(), try_drive_until(), and ~TimedDrivableExecutor().
|
overridevirtualnoexcept |
Implements DrivableExecutor.
Implements folly::DrivableExecutor.
Definition at line 30 of file TimedDrivableExecutor.cpp.
Referenced by ~TimedDrivableExecutor().
|
noexcept |
Do work. Returns the number of functions that were executed (maybe 0). Non-blocking, in the sense that we don't wait for work (we can't control whether one of the functions blocks). This is stable, it will not chase an ever-increasing tail of work. This also means, there may be more work available to perform at the moment that this returns.
Definition at line 35 of file TimedDrivableExecutor.cpp.
References count, f, func_, folly::gen::move, and queue_.
Referenced by drain(), drive(), TEST(), try_drive(), try_drive_for(), and try_drive_until().
|
inlinenoexcept |
Definition at line 43 of file TimedDrivableExecutor.h.
References run(), and try_wait().
Referenced by TEST().
|
inlinenoexcept |
Definition at line 51 of file TimedDrivableExecutor.h.
References run(), folly::detail::timeout, and try_wait_for().
Referenced by TEST().
|
inlinenoexcept |
Definition at line 60 of file TimedDrivableExecutor.h.
References add(), drain(), folly::pushmi::__adl::noexcept(), run(), try_wait_until(), and wait().
Referenced by TEST(), and folly::futures::detail::waitViaImpl().
|
inlinenoexcept |
Definition at line 87 of file TimedDrivableExecutor.h.
Referenced by try_drive().
|
inlinenoexcept |
Wait for work to do or for a period of timeout, whichever is sooner.
Definition at line 93 of file TimedDrivableExecutor.h.
References func_, queue_, and folly::detail::timeout.
Referenced by try_drive_for().
|
inlinenoexcept |
Wait for work to do or until deadline passes, whichever is sooner.
Definition at line 100 of file TimedDrivableExecutor.h.
Referenced by try_drive_until().
|
noexcept |
Wait for work to do.
Definition at line 64 of file TimedDrivableExecutor.cpp.
Referenced by drive(), and try_drive_until().
|
private |
Definition at line 107 of file TimedDrivableExecutor.h.
Referenced by run(), try_wait(), try_wait_for(), try_wait_until(), and wait().
|
private |
Definition at line 106 of file TimedDrivableExecutor.h.
Referenced by add(), run(), try_wait(), try_wait_for(), try_wait_until(), and wait().