proxygen
|
#include <AddTasks.h>
Classes | |
struct | Context |
Public Types | |
typedef T | value_type |
Public Member Functions | |
TaskIterator () | |
TaskIterator (const TaskIterator &other)=delete | |
TaskIterator & | operator= (const TaskIterator &other)=delete |
TaskIterator (TaskIterator &&other) noexcept | |
TaskIterator & | operator= (TaskIterator &&other)=delete |
template<typename F > | |
void | addTask (F &&func) |
bool | hasCompleted () const |
bool | hasPending () const |
bool | hasNext () const |
T | awaitNext () |
void | reserve (size_t n) |
size_t | getTaskID () const |
template<> | |
void | awaitNext () |
Private Member Functions | |
folly::Try< T > | awaitNextResult () |
Private Attributes | |
std::shared_ptr< Context > | context_ {std::make_shared<Context>()} |
size_t | id_ {std::numeric_limits<size_t>::max()} |
FiberManager & | fm_ |
Friends | |
template<class InputIterator > | |
TaskIterator< invoke_result_t< typename std::iterator_traits< InputIterator >::value_type > > | addTasks (InputIterator first, InputIterator last) |
Definition at line 30 of file AddTasks.h.
typedef T folly::fibers::TaskIterator< T >::value_type |
Definition at line 51 of file AddTasks.h.
|
inline |
Definition at line 53 of file AddTasks.h.
References folly::fibers::TaskIterator< T >::addTask(), folly::fibers::TaskIterator< T >::addTasks, folly::fibers::TaskIterator< T >::awaitNext(), folly::gen::first, folly::fibers::TaskIterator< T >::getTaskID(), folly::fibers::TaskIterator< T >::hasCompleted(), folly::fibers::TaskIterator< T >::hasNext(), folly::fibers::TaskIterator< T >::hasPending(), folly::pushmi::__adl::noexcept(), folly::fibers::TaskIterator< T >::operator=(), folly::fibers::TaskIterator< T >::reserve(), and folly::T.
|
delete |
|
noexcept |
Definition at line 23 of file AddTasks-inl.h.
void folly::fibers::TaskIterator< T >::addTask | ( | F && | func | ) |
Add one more task to the TaskIterator.
func | task to be added, will be scheduled on current FiberManager |
Definition at line 89 of file AddTasks-inl.h.
References context, folly::makeTryWith(), folly::gen::move, folly::T, and folly::value().
Referenced by folly::fibers::addTasks(), folly::fibers::TaskIterator< T >::TaskIterator(), and TEST().
|
inline |
Definition at line 57 of file AddTasks-inl.h.
|
inline |
Await for another task to complete. Will not await if the result is already available.
exception | thrown by the task. |
Definition at line 52 of file AddTasks-inl.h.
References folly::gen::move, and folly::value().
Referenced by folly::fibers::TaskIterator< T >::TaskIterator(), and TEST().
|
private |
|
inline |
Definition at line 82 of file AddTasks-inl.h.
Referenced by folly::fibers::TaskIterator< T >::TaskIterator().
|
inline |
Definition at line 27 of file AddTasks-inl.h.
Referenced by folly::fibers::TaskIterator< T >::TaskIterator().
|
inline |
Definition at line 37 of file AddTasks-inl.h.
Referenced by folly::fibers::TaskIterator< T >::TaskIterator().
|
inline |
Definition at line 32 of file AddTasks-inl.h.
Referenced by folly::fibers::TaskIterator< T >::TaskIterator().
|
delete |
Referenced by folly::fibers::TaskIterator< T >::TaskIterator().
|
delete |
|
inline |
Await until the specified number of tasks completes or there are no tasks left to await for. Note: Will not await if there are already the specified number of tasks available.
n | Number of tasks to await for completition. |
Definition at line 62 of file AddTasks-inl.h.
References folly::fibers::await(), min, and folly::gen::move.
Referenced by folly::fibers::TaskIterator< T >::TaskIterator().
|
friend |
Schedules several tasks and immediately returns an iterator, that allow one to traverse tasks in the order of their completion. All results and exceptions thrown are stored alongside with the task id and are accessible via iterator.
first | Range of tasks to be scheduled |
last |
Definition at line 114 of file AddTasks-inl.h.
Referenced by folly::fibers::TaskIterator< T >::TaskIterator().
|
private |
Definition at line 125 of file AddTasks.h.
|
private |
Definition at line 127 of file AddTasks.h.
|
private |
Definition at line 126 of file AddTasks.h.