proxygen
|
#include <AsyncIO.h>
Public Types | |
typedef std::function< AsyncIOOp *()> | OpFactory |
Public Member Functions | |
AsyncIOQueue (AsyncIO *asyncIO) | |
~AsyncIOQueue () | |
size_t | queued () const |
void | submit (AsyncIOOp *op) |
void | submit (OpFactory op) |
Private Member Functions | |
void | onCompleted (AsyncIOOp *op) |
void | maybeDequeue () |
Private Attributes | |
AsyncIO * | asyncIO_ |
std::deque< OpFactory > | queue_ |
Wrapper around AsyncIO that allows you to schedule more requests than the AsyncIO's object capacity. Other requests are queued and processed in a FIFO order.
typedef std::function<AsyncIOOp*()> folly::AsyncIOQueue::OpFactory |
|
explicit |
Create a queue, using the given AsyncIO object. The AsyncIO object may not be used by anything else until the queue is destroyed.
Definition at line 276 of file AsyncIO.cpp.
folly::AsyncIOQueue::~AsyncIOQueue | ( | ) |
|
private |
Definition at line 295 of file AsyncIO.cpp.
References asyncIO_, folly::AsyncIO::capacity(), onCompleted(), folly::AsyncIO::pending(), queue_, and folly::AsyncIO::submit().
Referenced by onCompleted(), and submit().
|
private |
Definition at line 291 of file AsyncIO.cpp.
References maybeDequeue().
Referenced by maybeDequeue().
|
inline |
void folly::AsyncIOQueue::submit | ( | AsyncIOOp * | op | ) |
Submit an op to the AsyncIO queue. The op will be queued until the AsyncIO object has room.
Definition at line 282 of file AsyncIO.cpp.
void folly::AsyncIOQueue::submit | ( | OpFactory | op | ) |
Definition at line 286 of file AsyncIO.cpp.
References maybeDequeue(), and queue_.
|
private |
Definition at line 274 of file AsyncIO.h.
Referenced by maybeDequeue(), and ~AsyncIOQueue().
|
private |
Definition at line 276 of file AsyncIO.h.
Referenced by maybeDequeue(), and submit().