YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
yaclib Namespace Reference

Namespaces

namespace  detail
 
namespace  fault
 
namespace  fiber
 

Classes

class  FairThreadPool
 TODO(kononovk) Doxygen docs. More...
 
class  Future
 Provides a mechanism to access the result of async operations. More...
 
class  FutureBase
 Provides a mechanism to access the result of async operations. More...
 
class  FutureOn
 Provides a mechanism to access the result of async operations. More...
 
class  IExecutor
 
class  IFunc
 Callable interface. More...
 
class  IntrusivePtr
 A intrusive pointer to objects with an embedded reference count. More...
 
class  IRef
 Reference counting interface. More...
 
class  Job
 Callable that can be executed in an IExecutor. More...
 
class  ManualExecutor
 TODO(mkornaukhov03) Doxygen. More...
 
class  Mutex
 Mutex for coroutines. More...
 
struct  NoRefTag
 
class  OneShotEvent
 This class useful to wait or co_await some event. More...
 
class  Promise
 
class  Result
 Encapsulated return value from caller. More...
 
struct  ResultEmpty
 
class  ResultError
 
class  SharedGuard
 
class  SharedMutex
 SharedMutex for coroutines. More...
 
class  StickyGuard
 
struct  StopError
 Default error. More...
 
class  Strand
 
class  Task
 Provides a mechanism to schedule the some async operations TODO(MBkkt) add description. More...
 
class  UniqueGuard
 
class  WaitGroup
 An object that allows you to Add some amount of async operations and then Wait for it to be Done. More...
 

Typedefs

template<typename V , typename E >
using Contract = std::pair< Future< V, E >, Promise< V, E > >
 Describes channel with future and promise.
 
template<typename V , typename E >
using ContractOn = std::pair< FutureOn< V, E >, Promise< V, E > >
 
using IExecutorPtr = IntrusivePtr< IExecutor >
 
using LogCallback = void(*)(std::string_view file, std::size_t line, std::string_view function, std::string_view condition, std::string_view message) noexcept
 
using IFuncPtr = IntrusivePtr< IFunc >
 
template<typename... Args>
using head_t = typename detail::Head< Args... >::Type
 
template<typename Func , typename... Arg>
using invoke_t = typename detail::Invoke< Func, Arg... >::Type
 
template<typename T >
using result_value_t = typename detail::InstantiationTypes< Result, T >::Value
 
template<typename T >
using result_error_t = typename detail::InstantiationTypes< Result, T >::Error
 
template<typename T >
using task_value_t = typename detail::InstantiationTypes< Task, T >::Value
 
template<typename T >
using task_error_t = typename detail::InstantiationTypes< Task, T >::Error
 
template<typename T >
using future_base_value_t = typename detail::FutureBaseTypes< T >::Value
 
template<typename T >
using future_base_error_t = typename detail::FutureBaseTypes< T >::Error
 

Enumerations

enum class  FailPolicy : unsigned char { None = 0 , FirstFail = 1 , LastFail = 2 }
 This Policy describe how algorithm interpret if Future will be fulfilled by fail (exception or error) More...
 
enum class  OrderPolicy : unsigned char { Fifo = 0 , Same = 1 }
 This Policy describe how algorithm produce result. More...
 
enum class  ResultState : unsigned char { Value = 0 , Exception = 1 , Error = 2 , Empty = 3 }
 

Functions

template<typename V = void, typename E = StopError>
Contract< V, E > MakeContract ()
 Creates related future and promise.
 
template<typename V = void, typename E = StopError>
ContractOn< V, EMakeContractOn (IExecutor &e)
 
template<typename V = Unit, typename E = StopError, typename... Args>
auto MakeFuture (Args &&... args)
 Function for create Ready Future.
 
template<typename E = StopError, typename Func >
auto Run (Func &&f)
 Execute Callable func on Inline executor.
 
template<typename E = StopError, typename Func >
auto Run (IExecutor &e, Func &&f)
 Execute Callable func on executor.
 
template<typename V = void, typename E = StopError, typename Func >
auto AsyncContract (Func &&f)
 Execute Callable func on Inline executor.
 
template<typename V = void, typename E = StopError, typename Func >
auto AsyncContract (IExecutor &e, Func &&f)
 Execute Callable func on executor.
 
template<typename Event = detail::DefaultEvent, typename... V, typename... E>
YACLIB_INLINE void Wait (FutureBase< V, E > &... fs) noexcept
 Wait until Ready becomes true.
 
template<typename Event = detail::DefaultEvent, typename It >
YACLIB_INLINE std::enable_if_t<!is_future_base_v< It >, voidWait (It begin, It end) noexcept
 Wait until Ready becomes true.
 
template<typename Event = detail::DefaultEvent, typename It >
YACLIB_INLINE void Wait (It begin, std::size_t count) noexcept
 Wait until Ready becomes true.
 
template<typename Event = detail::MutexEvent, typename Rep , typename Period , typename... V, typename... E>
YACLIB_INLINE bool WaitFor (const std::chrono::duration< Rep, Period > &timeout_duration, FutureBase< V, E > &... fs) noexcept
 Wait until the specified timeout duration has elapsed or Ready becomes true.
 
template<typename Event = detail::MutexEvent, typename Rep , typename Period , typename Iterator >
YACLIB_INLINE std::enable_if_t<!is_future_base_v< Iterator >, boolWaitFor (const std::chrono::duration< Rep, Period > &timeout_duration, Iterator begin, Iterator end) noexcept
 Wait until the specified timeout duration has elapsed or Ready becomes true.
 
template<typename Event = detail::MutexEvent, typename Rep , typename Period , typename Iterator >
YACLIB_INLINE bool WaitFor (const std::chrono::duration< Rep, Period > &timeout_duration, Iterator begin, std::size_t count) noexcept
 Wait until the specified timeout duration has elapsed or Ready becomes true.
 
template<typename Event = detail::MutexEvent, typename Clock , typename Duration , typename... V, typename... E>
YACLIB_INLINE bool WaitUntil (const std::chrono::time_point< Clock, Duration > &timeout_time, FutureBase< V, E > &... fs) noexcept
 Wait until specified time has been reached or Ready becomes true.
 
template<typename Event = detail::MutexEvent, typename Clock , typename Duration , typename Iterator >
YACLIB_INLINE std::enable_if_t<!is_future_base_v< Iterator >, boolWaitUntil (const std::chrono::time_point< Clock, Duration > &timeout_time, Iterator begin, Iterator end) noexcept
 Wait until specified time has been reached or Ready becomes true.
 
template<typename Event = detail::MutexEvent, typename Clock , typename Duration , typename Iterator >
YACLIB_INLINE bool WaitUntil (const std::chrono::time_point< Clock, Duration > &timeout_time, Iterator begin, std::size_t count) noexcept
 Wait until specified time has been reached or Ready becomes true.
 
template<FailPolicy F = FailPolicy::FirstFail, OrderPolicy O = OrderPolicy::Fifo, typename It , typename T = typename std::iterator_traits<It>::value_type>
auto WhenAll (It begin, std::size_t count)
 Create Future which will be ready when all futures are ready.
 
template<FailPolicy F = FailPolicy::FirstFail, OrderPolicy O = OrderPolicy::Fifo, typename It , typename T = typename std::iterator_traits<It>::value_type>
YACLIB_INLINE auto WhenAll (It begin, It end)
 Create Future which will be ready when all futures are ready.
 
template<FailPolicy F = FailPolicy::FirstFail, OrderPolicy O = OrderPolicy::Fifo, typename V , typename... E>
auto WhenAll (FutureBase< V, E > &&... futures)
 Create Future which will be ready when all futures are ready.
 
template<FailPolicy P = FailPolicy::LastFail, typename It , typename T = typename std::iterator_traits<It>::value_type>
auto WhenAny (It begin, std::size_t count)
 Create Future that is ready when any of futures is ready.
 
template<FailPolicy P = FailPolicy::LastFail, typename It , typename T = typename std::iterator_traits<It>::value_type>
YACLIB_INLINE auto WhenAny (It begin, It end)
 Create Future that is ready when any of futures is ready.
 
template<FailPolicy P = FailPolicy::LastFail, typename V , typename... E>
auto WhenAny (FutureBase< V, E > &&... futures)
 Create Future that is ready when any of futures is ready.
 
template<typename V , typename E >
YACLIB_INLINE auto Await (Task< V, E > &task) noexcept
 TODO(mkornaukhov03) Add doxygen docs.
 
template<typename... V, typename... E>
YACLIB_INLINE auto Await (FutureBase< V, E > &... fs) noexcept
 TODO(mkornaukhov03) Add doxygen docs.
 
template<typename Iterator >
YACLIB_INLINE auto Await (Iterator begin, std::size_t count) noexcept -> std::enable_if_t<!is_future_base_v< Iterator >, detail::AwaitAwaiter< false > >
 TODO(mkornaukhov03) Add doxygen docs.
 
template<typename Iterator >
YACLIB_INLINE auto Await (Iterator begin, Iterator end) noexcept -> std::enable_if_t<!is_future_base_v< Iterator >, detail::AwaitAwaiter< false > >
 TODO(mkornaukhov03) Add doxygen docs.
 
template<typename V , typename E >
YACLIB_INLINE auto operator co_await (FutureBase< V, E > &&future) noexcept
 
template<typename V , typename E >
YACLIB_INLINE auto operator co_await (Task< V, E > &&task) noexcept
 
template<typename... V, typename... E>
YACLIB_INLINE auto AwaitOn (IExecutor &e, FutureBase< V, E > &... fs) noexcept
 
template<typename Iterator >
YACLIB_INLINE auto AwaitOn (IExecutor &e, Iterator begin, std::size_t count) noexcept -> std::enable_if_t<!is_future_base_v< Iterator >, detail::AwaitOnAwaiter< false > >
 TODO(mkornaukhov03) Add doxygen docs.
 
template<typename BeginIt , typename EndIt >
YACLIB_INLINE auto AwaitOn (IExecutor &e, BeginIt begin, EndIt end) noexcept -> std::enable_if_t<!is_future_base_v< BeginIt >, detail::AwaitOnAwaiter< false > >
 TODO(mkornaukhov03) Add doxygen docs.
 
YACLIB_INLINE detail::CurrentAwaiter< falseCurrentExecutor () noexcept
 Get current executor.
 
YACLIB_INLINE detail::CurrentAwaiter< trueYield () noexcept
 Instead of.
 
YACLIB_INLINE detail::OnAwaiter On (IExecutor &e) noexcept
 TODO(mkornaukhov03) Add doxygen docs.
 
IExecutorMakeInline () noexcept
 Get Inline executor singleton object.
 
IExecutorMakeInline (StopTag) noexcept
 
IExecutorPtr MakeManual ()
 
IExecutorPtr MakeStrand (IExecutorPtr e)
 Strand is the asynchronous analogue of a mutex.
 
template<typename Func >
void Submit (IExecutor &executor, Func &&f)
 Submit given func for details.
 
void SetFaultFrequency (std::uint32_t freq) noexcept
 Sets frequency with which fault will be injected.
 
void SetSeed (std::uint32_t seed) noexcept
 Sets seed for random, which will be used when deciding when to yield, for fibers scheduler and random wrapper for tests.
 
void SetFaultSleepTime (std::uint32_t ns) noexcept
 Sets sleep time if sleep is used instead of yield for interrupting thread execution for fault injection.
 
std::uint32_t GetFaultSleepTime () noexcept
 
void SetAtomicFailFrequency (std::uint32_t k) noexcept
 Sets frequency with which compare_exchange_weak would fail.
 
detail::InjectorGetInjector () noexcept
 
void InjectFault () noexcept
 
std::uint64_t GetInjectedCount () noexcept
 
 YACLIB_DEFINE_VOID_TYPE (Unit)
 
 YACLIB_DEFINE_VOID_TYPE (StopTag)
 
template<typename V = Unit, typename E = StopError, typename... Args>
auto MakeTask (Args &&... args)
 TODO(MBkkt) add description.
 
template<typename E = StopError, typename Func >
auto Schedule (Func &&f)
 Execute Callable func on Inline executor.
 
template<typename E = StopError, typename Func >
auto Schedule (IExecutor &e, Func &&f)
 Execute Callable func on executor.
 
template<typename V = void, typename E = StopError, typename Func >
auto LazyContract (Func &&f)
 Execute Callable func on Inline executor.
 
template<typename V = void, typename E = StopError, typename Func >
auto LazyContract (IExecutor &e, Func &&f)
 Execute Callable func on executor.
 
IntrusivePtr< FairThreadPoolMakeFairThreadPool (std::uint64_t threads=yaclib_std::thread::hardware_concurrency())
 
template<typename To , typename From >
constexpr autoUpCast (From *from) noexcept
 
template<typename To , typename From , typename = std::enable_if_t<!std::is_pointer_v<From>>>
constexpr autoUpCast (From &from) noexcept
 
template<typename To , typename From >
constexpr autoDownCast (From *from) noexcept
 
template<typename To , typename From >
constexpr autoDownCast (From &from) noexcept
 
template<typename Func >
IFuncPtr MakeFunc (Func &&f)
 Create shared IFunc object from any Callable func.
 
template<typename ObjectT , typename... Args>
auto MakeUnique (Args &&... args)
 
template<typename ObjectT , typename... Args>
auto MakeShared (std::size_t n, Args &&... args)
 
template<typename T , typename U >
bool operator== (const IntrusivePtr< T > &lhs, const IntrusivePtr< U > &rhs) noexcept
 
template<typename T , typename U >
bool operator!= (const IntrusivePtr< T > &lhs, const IntrusivePtr< U > &rhs) noexcept
 
template<typename T , typename U >
bool operator== (const IntrusivePtr< T > &lhs, U *rhs) noexcept
 
template<typename T , typename U >
bool operator!= (const IntrusivePtr< T > &lhs, U *rhs) noexcept
 
template<typename T , typename U >
bool operator== (T *lhs, const IntrusivePtr< U > &rhs) noexcept
 
template<typename T , typename U >
bool operator!= (T *lhs, const IntrusivePtr< U > &rhs) noexcept
 
template<typename T >
bool operator== (const IntrusivePtr< T > &lhs, std::nullptr_t) noexcept
 
template<typename T >
bool operator== (std::nullptr_t, const IntrusivePtr< T > &rhs) noexcept
 
template<typename T >
bool operator!= (const IntrusivePtr< T > &lhs, std::nullptr_t) noexcept
 
template<typename T >
bool operator!= (std::nullptr_t, const IntrusivePtr< T > &rhs) noexcept
 
template<typename T >
bool operator< (const IntrusivePtr< T > &lhs, const IntrusivePtr< T > &rhs) noexcept
 
template<bool Condition, typename T >
decltype(automove_if (T &&arg) noexcept
 
template<typename T >
constexpr bool Check () noexcept
 

Variables

constexpr detail::Yield kYield
 Reschedule current job to it executor Useful for timeout checks, or if you job very big and doing only cpu not suspend work.
 
template<typename Func , typename... Arg>
constexpr bool is_invocable_v = detail::IsInvocable<Func, Arg...>::Value
 
template<typename T >
constexpr bool is_result_v = detail::IsInstantiationOf<Result, T>::Value
 
template<typename T >
constexpr bool is_future_base_v
 
template<typename T >
constexpr bool is_task_v = detail::IsInstantiationOf<Task, T>::Value
 

Typedef Documentation

◆ Contract

template<typename V , typename E >
using yaclib::Contract = typedef std::pair<Future<V, E>, Promise<V, E> >

Describes channel with future and promise.

Definition at line 13 of file contract.hpp.

◆ ContractOn

template<typename V , typename E >
using yaclib::ContractOn = typedef std::pair<FutureOn<V, E>, Promise<V, E> >

Definition at line 16 of file contract.hpp.

◆ future_base_error_t

◆ future_base_value_t

◆ head_t

template<typename... Args>
using yaclib::head_t = typedef typename detail::Head<Args...>::Type

Definition at line 13 of file type_traits.hpp.

◆ IExecutorPtr

◆ IFuncPtr

◆ invoke_t

template<typename Func , typename... Arg>
using yaclib::invoke_t = typedef typename detail::Invoke<Func, Arg...>::Type

Definition at line 19 of file type_traits.hpp.

◆ LogCallback

using yaclib::LogCallback = typedef void (*)(std::string_view file, std::size_t line, std::string_view function, std::string_view condition, std::string_view message) noexcept

Definition at line 9 of file log.hpp.

◆ result_error_t

◆ result_value_t

◆ task_error_t

◆ task_value_t

Enumeration Type Documentation

◆ FailPolicy

This Policy describe how algorithm interpret if Future will be fulfilled by fail (exception or error)

None – fail same as ok, another words save all fails FirstFail – save first fail, default for WhenAll LastFail – save last fail, default for WhenAny

Enumerator
None 
FirstFail 
LastFail 

Definition at line 12 of file fail_policy.hpp.

◆ OrderPolicy

This Policy describe how algorithm produce result.

Fifo – order of results is fifo Note: non-deterministic in multithreading environment Note: now it's default for WhenAll because it allow call delete early Same – order of results same as order of input

Enumerator
Fifo 
Same 

Definition at line 13 of file order_policy.hpp.

◆ ResultState

Enumerator
Value 
Exception 
Error 
Empty 

Definition at line 16 of file result.hpp.

Function Documentation

◆ AsyncContract() [1/2]

template<typename V = void, typename E = StopError, typename Func >
auto yaclib::AsyncContract ( Func &&  f)

Execute Callable func on Inline executor.

Parameters
ffunc to execute
Returns
Future corresponding f return value

Definition at line 64 of file run.hpp.

References MakeContract(), and MakeInline().

◆ AsyncContract() [2/2]

template<typename V = void, typename E = StopError, typename Func >
auto yaclib::AsyncContract ( IExecutor e,
Func &&  f 
)

Execute Callable func on executor.

Parameters
eexecutor to be used to execute f and saved as callback executor for return Future
ffunc to execute
Returns
FutureOn corresponding f return value

Definition at line 76 of file run.hpp.

References yaclib::IExecutor::Inline, MakeContract(), and YACLIB_WARN.

◆ Await() [1/4]

template<typename... V, typename... E>
YACLIB_INLINE auto yaclib::Await ( FutureBase< V, E > &...  fs)
noexcept

TODO(mkornaukhov03) Add doxygen docs.

Definition at line 23 of file await.hpp.

References MakeContract(), and YACLIB_ASSERT.

◆ Await() [2/4]

template<typename Iterator >
YACLIB_INLINE auto yaclib::Await ( Iterator  begin,
Iterator  end 
) -> std::enable_if_t<!is_future_base_v<Iterator>, detail::AwaitAwaiter<false>>
noexcept

TODO(mkornaukhov03) Add doxygen docs.

Definition at line 41 of file await.hpp.

References Await(), and MakeContract().

◆ Await() [3/4]

template<typename Iterator >
YACLIB_INLINE auto yaclib::Await ( Iterator  begin,
std::size_t  count 
) -> std::enable_if_t<!is_future_base_v<Iterator>, detail::AwaitAwaiter<false>>
noexcept

TODO(mkornaukhov03) Add doxygen docs.

Definition at line 32 of file await.hpp.

References MakeContract().

◆ Await() [4/4]

template<typename V , typename E >
YACLIB_INLINE auto yaclib::Await ( Task< V, E > &  task)
noexcept

TODO(mkornaukhov03) Add doxygen docs.

Definition at line 14 of file await.hpp.

References MakeContract(), and YACLIB_ASSERT.

Referenced by Await().

◆ AwaitOn() [1/3]

YACLIB_INLINE auto yaclib::AwaitOn ( IExecutor e,
BeginIt  begin,
EndIt  end 
) -> std::enable_if_t<!is_future_base_v<BeginIt>, detail::AwaitOnAwaiter<false>>
noexcept

TODO(mkornaukhov03) Add doxygen docs.

Definition at line 28 of file await_on.hpp.

References AwaitOn(), and MakeContract().

◆ AwaitOn() [2/3]

template<typename... V, typename... E>
YACLIB_INLINE auto yaclib::AwaitOn ( IExecutor e,
FutureBase< V, E > &...  fs 
)
noexcept

Definition at line 11 of file await_on.hpp.

References MakeContract().

Referenced by AwaitOn().

◆ AwaitOn() [3/3]

template<typename Iterator >
YACLIB_INLINE auto yaclib::AwaitOn ( IExecutor e,
Iterator  begin,
std::size_t  count 
) -> std::enable_if_t<!is_future_base_v<Iterator>, detail::AwaitOnAwaiter<false>>
noexcept

TODO(mkornaukhov03) Add doxygen docs.

Definition at line 19 of file await_on.hpp.

References MakeContract().

◆ Check()

template<typename T >
constexpr bool yaclib::Check ( )
constexprnoexcept

Definition at line 59 of file type_traits.hpp.

References MakeContract().

◆ CurrentExecutor()

YACLIB_INLINE detail::CurrentAwaiter< false > yaclib::CurrentExecutor ( )
noexcept

Get current executor.

Definition at line 41 of file current_executor.hpp.

◆ DownCast() [1/2]

template<typename To , typename From >
constexpr auto & yaclib::DownCast ( From &  from)
constexprnoexcept

Definition at line 39 of file cast.hpp.

References MakeContract().

◆ DownCast() [2/2]

template<typename To , typename From >
constexpr auto * yaclib::DownCast ( From *  from)
constexprnoexcept

Definition at line 26 of file cast.hpp.

References MakeContract(), and YACLIB_ASSERT.

◆ GetFaultSleepTime()

std::uint32_t yaclib::GetFaultSleepTime ( )
noexcept

◆ GetInjectedCount()

std::uint64_t yaclib::GetInjectedCount ( )
noexcept

Definition at line 15 of file inject.cpp.

References yaclib::detail::Injector::GetInjectedCount().

◆ GetInjector()

detail::Injector * yaclib::GetInjector ( )
noexcept

◆ InjectFault()

void yaclib::InjectFault ( )
noexcept

Definition at line 11 of file inject.cpp.

References GetInjector(), and yaclib::detail::Injector::MaybeInject().

◆ LazyContract() [1/2]

template<typename V = void, typename E = StopError, typename Func >
auto yaclib::LazyContract ( Func &&  f)

Execute Callable func on Inline executor.

Parameters
ffunc to execute
Returns
Future corresponding f return value

Definition at line 58 of file schedule.hpp.

References MakeContract(), and MakeInline().

◆ LazyContract() [2/2]

template<typename V = void, typename E = StopError, typename Func >
auto yaclib::LazyContract ( IExecutor e,
Func &&  f 
)

Execute Callable func on executor.

Parameters
eexecutor to be used to execute f and saved as callback executor for return Future
ffunc to execute
Returns
Task corresponding f return value

Definition at line 70 of file schedule.hpp.

References yaclib::IExecutor::Inline, MakeContract(), and YACLIB_WARN.

◆ MakeContract()

template<typename V = void, typename E = StopError>
Contract< V, E > yaclib::MakeContract ( )

Creates related future and promise.

Returns
a
See also
Contract object with new future and promise
Examples
simple.cpp.

Definition at line 25 of file contract.hpp.

References MakeContract().

Referenced by yaclib::detail::AtomicCounter< CounterBase, Deleter >::Add(), yaclib::detail::AllCombinator< O, R, E >::AddInput(), yaclib::detail::AllCombinator< OrderPolicy::Same, R, E >::AddInput(), yaclib::detail::AnyCombinator< V, E, P >::AddInput(), yaclib::detail::fiber::DefaultAllocator::Allocate(), AsyncContract(), AsyncContract(), yaclib::WaitGroup< Event >::Attach(), yaclib::WaitGroup< Event >::Attach(), yaclib::WaitGroup< Event >::Attach(), Await(), Await(), Await(), Await(), yaclib::detail::Destroy::await_suspend(), yaclib::detail::MutexImpl< FIFO, Batching >::AwaitLock(), yaclib::detail::SharedMutexImpl< FIFO, ReadersFIFO >::AwaitLock(), yaclib::detail::SharedMutexImpl< FIFO, ReadersFIFO >::AwaitLockShared(), AwaitOn(), AwaitOn(), AwaitOn(), yaclib::detail::AwaitOnAwaiter< false >::AwaitOnAwaiter(), yaclib::detail::AwaitOnAwaiter< false >::AwaitOnAwaiter(), yaclib::detail::AwaitOnEvent< Single >::AwaitOnEvent(), yaclib::detail::MutexImpl< FIFO, Batching >::AwaitUnlock(), yaclib::detail::MutexImpl< FIFO, Batching >::AwaitUnlockOn(), yaclib::detail::BaseCore::BaseCore(), yaclib::detail::MutexImpl< FIFO, Batching >::BatchingPossible(), yaclib::detail::fiber::BiList::BiList(), yaclib::OneShotEvent::Call(), yaclib::detail::ReadyCore< V, E >::Call(), yaclib::detail::BaseCore::CallInline(), yaclib::Task< V, E >::Cancel(), yaclib::Mutex< Batching, FIFO >::Cast(), yaclib::SharedMutex< FIFO, ReadersFIFO >::Cast(), Check(), yaclib::detail::AtomicFlag< Impl >::clear(), yaclib::detail::AtomicFlag< Impl >::clear(), yaclib::detail::AnyCombinatorBase< V, E, FailPolicy::LastFail >::Combine(), yaclib::detail::AnyCombinatorBase< V, E, FailPolicy::FirstFail >::Combine(), yaclib::detail::AtomicBase< Impl, T >::compare_exchange_strong(), yaclib::detail::AtomicBase< Impl, T >::compare_exchange_strong(), yaclib::detail::AtomicBase< Impl, T >::compare_exchange_strong(), yaclib::detail::AtomicBase< Impl, T >::compare_exchange_strong(), yaclib::detail::fiber::AtomicBase< T >::compare_exchange_strong(), yaclib::detail::fiber::AtomicBase< T >::compare_exchange_strong(), yaclib::detail::fiber::AtomicBase< T >::compare_exchange_strong(), yaclib::detail::fiber::AtomicBase< T >::compare_exchange_strong(), yaclib::detail::AtomicBase< Impl, T >::compare_exchange_weak(), yaclib::detail::AtomicBase< Impl, T >::compare_exchange_weak(), yaclib::detail::AtomicBase< Impl, T >::compare_exchange_weak(), yaclib::detail::AtomicBase< Impl, T >::compare_exchange_weak(), yaclib::detail::fiber::AtomicBase< T >::compare_exchange_weak(), yaclib::detail::fiber::AtomicBase< T >::compare_exchange_weak(), yaclib::detail::fiber::AtomicBase< T >::compare_exchange_weak(), yaclib::detail::fiber::AtomicBase< T >::compare_exchange_weak(), yaclib::detail::fiber::AtomicBase< T >::CompareExchangeHelper(), yaclib::WaitGroup< Event >::Consume(), yaclib::WaitGroup< Event >::Consume(), yaclib::WaitGroup< Event >::Consume(), yaclib::detail::CVStatusFrom(), yaclib::detail::CVStatusFrom(), yaclib::detail::PromiseTypeDeleter< Lazy >::Delete(), yaclib::FutureBase< V, E >::Detach(), yaclib::Task< V, E >::Detach(), yaclib::FutureOn< V, E >::Detach(), yaclib::Task< V, E >::Detach(), yaclib::FutureBase< V, E >::Detach(), yaclib::FutureBase< V, E >::DetachInline(), DownCast(), DownCast(), yaclib::ManualExecutor::Drain(), yaclib::detail::ReadyCore< V, E >::Drop(), yaclib::detail::BaseCore::Empty(), yaclib::detail::fiber::Node::Erase(), yaclib::detail::AtomicBase< Impl, T >::exchange(), yaclib::detail::AtomicBase< Impl, T >::exchange(), yaclib::detail::fiber::AtomicBase< T >::exchange(), yaclib::detail::fiber::AtomicBase< T >::exchange(), yaclib::detail::fiber::ExecutionContext::Exit(), yaclib::FairThreadPool::FairThreadPool(), yaclib::detail::Atomic< Impl, U * >::fetch_add(), yaclib::detail::Atomic< Impl, U * >::fetch_add(), yaclib::detail::fiber::Atomic< U * >::fetch_add(), yaclib::detail::fiber::Atomic< U * >::fetch_add(), yaclib::detail::AtomicFloatingBase< Impl, T, true >::fetch_add(), yaclib::detail::AtomicFloatingBase< Impl, T, true >::fetch_add(), yaclib::detail::fiber::AtomicFloatingBase< T, true >::fetch_add(), yaclib::detail::fiber::AtomicFloatingBase< T, true >::fetch_add(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::fetch_and(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::fetch_and(), yaclib::detail::fiber::AtomicIntegralBase< T, true >::fetch_and(), yaclib::detail::fiber::AtomicIntegralBase< T, true >::fetch_and(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::fetch_or(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::fetch_or(), yaclib::detail::fiber::AtomicIntegralBase< T, true >::fetch_or(), yaclib::detail::fiber::AtomicIntegralBase< T, true >::fetch_or(), yaclib::detail::Atomic< Impl, U * >::fetch_sub(), yaclib::detail::Atomic< Impl, U * >::fetch_sub(), yaclib::detail::fiber::Atomic< U * >::fetch_sub(), yaclib::detail::fiber::Atomic< U * >::fetch_sub(), yaclib::detail::AtomicFloatingBase< Impl, T, true >::fetch_sub(), yaclib::detail::AtomicFloatingBase< Impl, T, true >::fetch_sub(), yaclib::detail::fiber::AtomicFloatingBase< T, true >::fetch_sub(), yaclib::detail::fiber::AtomicFloatingBase< T, true >::fetch_sub(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::fetch_xor(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::fetch_xor(), yaclib::detail::fiber::AtomicIntegralBase< T, true >::fetch_xor(), yaclib::detail::fiber::AtomicIntegralBase< T, true >::fetch_xor(), yaclib::fiber::ForwardToFaultRandomCount(), yaclib::detail::ForwardToRandCount(), yaclib::detail::fiber::SystemClock::from_time_t(), yaclib::detail::FuncCore< Func >::FuncCore(), yaclib::Future< V, E >::Future(), yaclib::FutureBase< V, E >::FutureBase(), yaclib::FutureOn< V, E >::FutureOn(), yaclib::FutureBase< V, E >::Get(), yaclib::detail::PromiseType< V, E, Lazy >::get_return_object(), yaclib::detail::fiber::BiList::GetElement(), yaclib::detail::fiber::GetImpl(), GetInjector(), yaclib::detail::fiber::GetMap(), yaclib::detail::GetRandCount(), yaclib::detail::GetRandNumber(), yaclib::detail::fiber::FiberBase::GetTLS(), yaclib::detail::Guard< M, Shared >::Guard(), yaclib::detail::Guard< M, Shared >::Guard(), yaclib::detail::Guard< M, Shared >::Guard(), yaclib::detail::Guard< M, Shared >::Guard(), yaclib::detail::GuardState::GuardState(), yaclib::detail::GuardState::GuardState(), yaclib::detail::PromiseType< V, E, Lazy >::Handle(), yaclib::FairThreadPool::HardStop(), yaclib::detail::ReadyCore< V, E >::Here(), yaclib::detail::ResultCore< V, E >::Here(), yaclib::detail::PromiseType< V, E, Lazy >::initial_suspend(), yaclib::IntrusivePtr< T >::IntrusivePtr(), yaclib::IntrusivePtr< T >::IntrusivePtr(), yaclib::IntrusivePtr< T >::IntrusivePtr(), yaclib::IntrusivePtr< T >::IntrusivePtr(), yaclib::IntrusivePtr< T >::IntrusivePtr(), yaclib::IntrusivePtr< T >::IntrusivePtr(), LazyContract(), LazyContract(), yaclib::detail::List::List(), yaclib::detail::AtomicBase< Impl, T >::load(), yaclib::detail::AtomicBase< Impl, T >::load(), yaclib::detail::Guard< M, Shared >::Lock(), yaclib::StickyGuard< M >::Lock(), yaclib::detail::LogMessage(), yaclib::detail::Loop(), yaclib::detail::AllCombinator< O, R, E >::Make(), yaclib::detail::AllCombinator< OrderPolicy::Same, R, E >::Make(), yaclib::detail::AnyCombinator< V, E, P >::Make(), MakeContract(), MakeContractOn(), yaclib::detail::MakeCore(), yaclib::detail::MakeDrop(), MakeFairThreadPool(), MakeFunc(), MakeFuture(), MakeInline(), MakeInline(), MakeManual(), MakeShared(), MakeStrand(), MakeTask(), MakeUnique(), yaclib::detail::MakeUniqueJob(), move_if(), yaclib::detail::BaseCore::MoveExecutorTo(), yaclib::detail::MoveToCaller(), yaclib::detail::Guard< M, Shared >::Mutex(), yaclib::detail::Noop(), yaclib::detail::fiber::FiberQueue::NotifyAll(), On(), operator co_await(), operator co_await(), operator!=(), operator!=(), operator!=(), yaclib::detail::fiber::operator!=(), yaclib::detail::fiber::operator!=(), yaclib::detail::fiber::operator!=(), operator!=(), yaclib::detail::fiber::operator!=(), operator!=(), yaclib::detail::fiber::operator!=(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::operator&=(), yaclib::detail::fiber::AtomicIntegralBase< T, true >::operator&=(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::operator&=(), yaclib::detail::fiber::AtomicIntegralBase< T, true >::operator&=(), yaclib::detail::fiber::ThreadLocalPtrProxy< Type >::operator*(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::operator++(), yaclib::detail::Atomic< Impl, U * >::operator++(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::operator++(), yaclib::detail::Atomic< Impl, U * >::operator++(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::operator++(), yaclib::detail::Atomic< Impl, U * >::operator++(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::operator++(), yaclib::detail::Atomic< Impl, U * >::operator++(), yaclib::detail::Atomic< Impl, U * >::operator+=(), yaclib::detail::fiber::Atomic< U * >::operator+=(), yaclib::detail::Atomic< Impl, U * >::operator+=(), yaclib::detail::fiber::Atomic< U * >::operator+=(), yaclib::detail::AtomicFloatingBase< Impl, T, true >::operator+=(), yaclib::detail::fiber::AtomicFloatingBase< T, true >::operator+=(), yaclib::detail::AtomicFloatingBase< Impl, T, true >::operator+=(), yaclib::detail::fiber::AtomicFloatingBase< T, true >::operator+=(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::operator--(), yaclib::detail::Atomic< Impl, U * >::operator--(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::operator--(), yaclib::detail::Atomic< Impl, U * >::operator--(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::operator--(), yaclib::detail::Atomic< Impl, U * >::operator--(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::operator--(), yaclib::detail::Atomic< Impl, U * >::operator--(), yaclib::detail::Atomic< Impl, U * >::operator-=(), yaclib::detail::fiber::Atomic< U * >::operator-=(), yaclib::detail::Atomic< Impl, U * >::operator-=(), yaclib::detail::fiber::Atomic< U * >::operator-=(), yaclib::detail::AtomicFloatingBase< Impl, T, true >::operator-=(), yaclib::detail::fiber::AtomicFloatingBase< T, true >::operator-=(), yaclib::detail::AtomicFloatingBase< Impl, T, true >::operator-=(), yaclib::detail::fiber::AtomicFloatingBase< T, true >::operator-=(), operator<(), yaclib::detail::fiber::operator<(), yaclib::detail::fiber::operator<(), yaclib::detail::fiber::operator<(), yaclib::detail::fiber::operator<(), yaclib::detail::fiber::operator<(), yaclib::detail::fiber::operator<=(), yaclib::detail::fiber::operator<=(), yaclib::detail::fiber::operator<=(), yaclib::detail::fiber::operator<=(), yaclib::detail::fiber::operator<=(), yaclib::Result< ValueT, E >::operator=(), yaclib::detail::fiber::BiList::operator=(), yaclib::IntrusivePtr< V, E >::operator=(), yaclib::IntrusivePtr< T >::operator=(), yaclib::detail::fiber::ThreadLocalPtrProxy< Type >::operator=(), yaclib::detail::fiber::ThreadLocalPtrProxy< Type >::operator=(), yaclib::detail::fiber::FiberQueue::operator=(), yaclib::detail::Guard< M, Shared >::operator=(), yaclib::detail::GuardState::operator=(), yaclib::IntrusivePtr< T >::operator=(), yaclib::IntrusivePtr< T >::operator=(), yaclib::detail::fiber::Stack::operator=(), yaclib::StickyGuard< M >::operator=(), yaclib::detail::AtomicBase< Impl, T >::operator=(), yaclib::detail::fiber::AtomicWait< T >::operator=(), yaclib::detail::AtomicBase< Impl, T >::operator=(), yaclib::detail::fiber::AtomicWait< T >::operator=(), yaclib::detail::fiber::Thread::operator=(), yaclib::detail::fiber::ThreadLocalPtrProxy< Type >::operator=(), yaclib::detail::fiber::ThreadLocalPtrProxy< Type >::operator=(), yaclib::detail::fiber::ThreadLocalPtrProxy< Type >::operator=(), operator==(), operator==(), operator==(), yaclib::detail::fiber::operator==(), yaclib::detail::fiber::operator==(), yaclib::detail::fiber::operator==(), operator==(), yaclib::detail::fiber::operator==(), operator==(), yaclib::detail::fiber::operator==(), yaclib::detail::fiber::operator>(), yaclib::detail::fiber::operator>(), yaclib::detail::fiber::operator>(), yaclib::detail::fiber::operator>(), yaclib::detail::fiber::operator>(), yaclib::detail::fiber::operator>=(), yaclib::detail::fiber::operator>=(), yaclib::detail::fiber::operator>=(), yaclib::detail::fiber::operator>=(), yaclib::detail::fiber::operator>=(), yaclib::detail::fiber::ThreadLocalPtrProxy< Type >::operator[](), yaclib::detail::AtomicIntegralBase< Impl, T, true >::operator^=(), yaclib::detail::fiber::AtomicIntegralBase< T, true >::operator^=(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::operator^=(), yaclib::detail::fiber::AtomicIntegralBase< T, true >::operator^=(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::operator|=(), yaclib::detail::fiber::AtomicIntegralBase< T, true >::operator|=(), yaclib::detail::AtomicIntegralBase< Impl, T, true >::operator|=(), yaclib::detail::fiber::AtomicIntegralBase< T, true >::operator|=(), yaclib::detail::fiber::PollRandomElementFromList(), yaclib::detail::fiber::BiList::PopBack(), yaclib::detail::List::PopFront(), yaclib::Promise< V, E >::Promise(), yaclib::detail::fiber::BiList::PushAll(), yaclib::detail::List::PushBack(), yaclib::detail::Stack::PushBack(), yaclib::detail::fiber::BiList::PushBack(), yaclib::detail::List::PushFront(), yaclib::detail::Stack::PushFront(), yaclib::detail::ReadyCore< V, E >::ReadyCore(), yaclib::detail::Guard< M, Shared >::Release(), yaclib::IntrusivePtr< T >::Release(), yaclib::detail::fiber::DefaultAllocator::Release(), yaclib::detail::GuardState::ReleaseState(), yaclib::detail::BaseCore::Reset(), yaclib::OneShotEvent::Reset(), yaclib::IntrusivePtr< T >::Reset(), yaclib::Result< ValueT, E >::Result(), yaclib::Result< ValueT, E >::Result(), yaclib::ResultError< Error >::ResultError(), yaclib::detail::fiber::FiberBase::Resume(), yaclib::detail::PromiseType< V, E, Lazy >::return_value(), Run(), yaclib::detail::Run(), Run(), Schedule(), yaclib::detail::Schedule(), Schedule(), yaclib::OneShotEvent::Set(), yaclib::Promise< V, E >::Set(), yaclib::fault::Scheduler::Set(), yaclib::detail::fiber::Set(), SetAtomicFailFrequency(), yaclib::detail::SetAtomicWeakFailFrequency(), yaclib::detail::fiber::DefaultAllocator::SetCacheSize(), yaclib::detail::BaseCore::SetCallback(), yaclib::detail::SetCallback(), yaclib::detail::SetCallback(), yaclib::detail::fiber::SetDefault(), SetFaultFrequency(), yaclib::fiber::SetFaultRandomListPick(), SetFaultSleepTime(), yaclib::fiber::SetFaultTickLength(), yaclib::detail::Injector::SetFrequency(), yaclib::fiber::SetHardwareConcurrency(), yaclib::fiber::SetInjectorState(), yaclib::detail::BaseCore::SetInline(), yaclib::detail::fiber::FiberBase::SetJoiningFiber(), yaclib::detail::fiber::DefaultAllocator::SetMinStackSize(), yaclib::detail::fiber::SetRandomListPick(), yaclib::detail::BaseCore::SetResult(), yaclib::detail::SetSeed(), SetSeed(), yaclib::detail::Injector::SetSleepTime(), yaclib::fiber::SetStackCacheSize(), yaclib::fiber::SetStackSize(), yaclib::detail::fiber::FiberBase::SetState(), yaclib::detail::Injector::SetState(), yaclib::fault::Scheduler::SetTickLength(), yaclib::detail::fiber::FiberBase::SetTLS(), yaclib::detail::fiber::ExecutionContext::Setup(), yaclib::detail::ShouldFailAtomicWeak(), yaclib::fault::Scheduler::Sleep(), yaclib::fault::Scheduler::SleepPreemptive(), yaclib::detail::Stack::Stack(), yaclib::detail::fiber::ExecutionContext::Start(), yaclib::detail::Start(), yaclib::detail::Start(), yaclib::detail::Step(), yaclib::StickyGuard< M >::StickyGuard(), yaclib::detail::ResultCore< V, E >::Store(), yaclib::detail::AtomicBase< Impl, T >::store(), yaclib::detail::AtomicBase< Impl, T >::store(), yaclib::detail::fiber::AtomicBase< T >::store(), yaclib::detail::fiber::AtomicBase< T >::store(), yaclib::detail::BaseCore::StoreCallback(), yaclib::Strand::Strand(), yaclib::detail::AtomicCounter< CounterBase, Deleter >::Sub(), yaclib::detail::AtomicCounter< CounterBase, Deleter >::SubEqual(), Submit(), yaclib::ManualExecutor::Submit(), yaclib::Strand::Submit(), yaclib::detail::Guard< M, Shared >::Swap(), yaclib::detail::GuardState::Swap(), yaclib::IntrusivePtr< T >::Swap(), yaclib::StickyGuard< M >::Swap(), yaclib::detail::fiber::Thread::swap(), yaclib::detail::fiber::ExecutionContext::SwitchTo(), yaclib::detail::Tag(), yaclib::Task< V, E >::Task(), TEST(), TEST(), yaclib::detail::AtomicFlag< Impl >::test_and_set(), yaclib::detail::AtomicFlag< Impl >::test_and_set(), yaclib::detail::fiber::AtomicFlag::test_and_set(), yaclib::detail::fiber::AtomicFlag::test_and_set(), yaclib::FutureOn< V, E >::Then(), yaclib::Task< V, E >::Then(), yaclib::FutureBase< V, E >::Then(), yaclib::Task< V, E >::Then(), yaclib::Future< V, E >::ThenInline(), yaclib::FutureOn< V, E >::ThenInline(), yaclib::Task< V, E >::ThenInline(), yaclib::detail::fiber::Thread::Thread(), yaclib::detail::fiber::ThreadLocalPtrProxy< Type >::ThreadLocalPtrProxy(), yaclib::detail::fiber::ThreadLocalPtrProxy< Type >::ThreadLocalPtrProxy(), yaclib::detail::fiber::ThreadLocalPtrProxy< Type >::ThreadLocalPtrProxy(), yaclib::Task< V, E >::ToFuture(), yaclib::FutureBase< V, E >::Touch(), yaclib::Task< V, E >::Touch(), yaclib::detail::fiber::Fiber< Args >::Trampoline(), yaclib::detail::Mutex< Impl >::try_lock(), yaclib::detail::fiber::RecursiveTimedMutex::try_lock_for(), yaclib::detail::fiber::SharedTimedMutex::try_lock_for(), yaclib::detail::fiber::TimedMutex::try_lock_for(), yaclib::detail::SharedTimedMutex< Impl >::try_lock_for(), yaclib::detail::TimedMutex< Impl >::try_lock_for(), yaclib::detail::SharedMutex< Impl >::try_lock_shared(), yaclib::detail::fiber::SharedTimedMutex::try_lock_shared_for(), yaclib::detail::SharedTimedMutex< Impl >::try_lock_shared_for(), yaclib::detail::fiber::SharedTimedMutex::try_lock_shared_until(), yaclib::detail::SharedTimedMutex< Impl >::try_lock_shared_until(), yaclib::detail::fiber::RecursiveTimedMutex::try_lock_until(), yaclib::detail::fiber::SharedTimedMutex::try_lock_until(), yaclib::detail::fiber::TimedMutex::try_lock_until(), yaclib::detail::SharedTimedMutex< Impl >::try_lock_until(), yaclib::detail::TimedMutex< Impl >::try_lock_until(), yaclib::OneShotEvent::TryAdd(), yaclib::detail::Guard< M, Shared >::TryLock(), yaclib::detail::MutexImpl< FIFO, Batching >::TryLockAwait(), yaclib::detail::SharedMutexImpl< FIFO, ReadersFIFO >::TryLockAwait(), yaclib::detail::SharedMutexImpl< FIFO, ReadersFIFO >::TryLockShared(), yaclib::detail::MutexImpl< FIFO, Batching >::TryUnlockAwait(), yaclib::detail::Guard< M, Shared >::Unlock(), yaclib::StickyGuard< M >::Unlock(), yaclib::detail::Guard< M, Shared >::UnlockHere(), yaclib::detail::SharedMutexImpl< FIFO, ReadersFIFO >::UnlockHere(), yaclib::detail::SharedMutexImpl< FIFO, ReadersFIFO >::UnlockHereShared(), yaclib::detail::Guard< M, Shared >::UnlockOn(), yaclib::Mutex< Batching, FIFO >::UnlockOn(), UpCast(), UpCast(), yaclib::OneShotEvent::Wait(), yaclib::FairThreadPool::Wait(), yaclib::detail::fiber::FiberQueue::Wait(), Wait(), Wait(), Wait(), yaclib::detail::ConditionVariableAny< Impl >::wait(), yaclib::detail::fiber::ConditionVariable::wait(), yaclib::detail::ConditionVariable< Impl >::wait(), yaclib::detail::ConditionVariable< Impl >::wait(), yaclib::detail::MutexEvent::Wait(), yaclib::detail::MutexEvent::Wait(), yaclib::detail::MutexEvent::Wait(), yaclib::detail::ConditionVariableAny< Impl >::wait_for(), yaclib::detail::ConditionVariableAny< Impl >::wait_for(), yaclib::detail::fiber::ConditionVariable::wait_for(), yaclib::detail::ConditionVariable< Impl >::wait_for(), yaclib::detail::ConditionVariable< Impl >::wait_for(), yaclib::detail::ConditionVariableAny< Impl >::wait_until(), yaclib::detail::ConditionVariableAny< Impl >::wait_until(), yaclib::detail::fiber::ConditionVariable::wait_until(), yaclib::detail::ConditionVariable< Impl >::wait_until(), yaclib::detail::ConditionVariable< Impl >::wait_until(), yaclib::detail::WaitCore(), yaclib::OneShotEvent::WaitFor(), yaclib::WaitGroup< Event >::WaitFor(), WaitFor(), WaitFor(), WaitFor(), yaclib::detail::WaitIterator(), yaclib::detail::WaitRange(), yaclib::OneShotEvent::WaitUntil(), yaclib::WaitGroup< Event >::WaitUntil(), WaitUntil(), WaitUntil(), WaitUntil(), WhenAll(), WhenAll(), WhenAll(), WhenAny(), WhenAny(), WhenAny(), yaclib::detail::WhenImpl(), yaclib::detail::WhenImpl(), yaclib::detail::WhenSetResult(), yaclib::detail::AllCombinator< O, R, E >::~AllCombinator(), yaclib::detail::AllCombinator< OrderPolicy::Same, R, E >::~AllCombinator(), yaclib::detail::AnyCombinatorBase< V, E, FailPolicy::FirstFail >::~AnyCombinatorBase(), yaclib::detail::fiber::Fiber< Args >::~Fiber(), yaclib::Promise< V, E >::~Promise(), and yaclib::detail::ResultCore< V, E >::~ResultCore().

◆ MakeContractOn()

template<typename V = void, typename E = StopError>
ContractOn< V, E > yaclib::MakeContractOn ( IExecutor e)

Definition at line 33 of file contract.hpp.

References MakeContract().

◆ MakeFairThreadPool()

IntrusivePtr< FairThreadPool > yaclib::MakeFairThreadPool ( std::uint64_t  threads = yaclib_std::thread::hardware_concurrency())

Definition at line 109 of file fair_thread_pool.cpp.

References MakeContract().

◆ MakeFunc()

template<typename Func >
IFuncPtr yaclib::MakeFunc ( Func &&  f)

Create shared IFunc object from any Callable func.

Parameters
fCallable object

Definition at line 36 of file shared_func.hpp.

References MakeContract().

◆ MakeFuture()

template<typename V = Unit, typename E = StopError, typename... Args>
auto yaclib::MakeFuture ( Args &&...  args)

Function for create Ready Future.

Template Parameters
Vif not default value, it's type of Future value
Etype of Future error, by default its
Argsif single, and V default, then used as type of Future value
Parameters
argsfor fulfill Future
Returns
Ready Future

Definition at line 25 of file make.hpp.

References MakeContract().

◆ MakeInline() [1/2]

IExecutor & yaclib::MakeInline ( )
noexcept

Get Inline executor singleton object.

This executor immediately executes given Callable object in the same OS thread without any overhead. So it always return false from Submit, we only call Call, no submit

Note
This object is useful as safe default executor value. See example.
auto task = [] {};
// Without inline executor:
if (...) {
}
if (executor) {
executor->Submit(task);
} else {
a();
}
// With inline executor:
if (...) {
}
executor->Submit(task);
IExecutor & MakeInline() noexcept
Get Inline executor singleton object.
Definition inline.cpp:34
Contract< V, E > MakeContract()
Creates related future and promise.
Definition contract.hpp:25
IntrusivePtr< IExecutor > IExecutorPtr
Definition executor.hpp:54

Definition at line 34 of file inline.cpp.

References MakeContract().

Referenced by AsyncContract(), yaclib::Task< V, E >::Cancel(), LazyContract(), Run(), and Schedule().

◆ MakeInline() [2/2]

IExecutor & yaclib::MakeInline ( StopTag  )
noexcept

Definition at line 38 of file inline.cpp.

References MakeContract().

◆ MakeManual()

IExecutorPtr yaclib::MakeManual ( )

Definition at line 28 of file manual.cpp.

References MakeContract().

◆ MakeShared()

template<typename ObjectT , typename... Args>
auto yaclib::MakeShared ( std::size_t  n,
Args &&...  args 
)

Definition at line 32 of file helper.hpp.

References MakeContract().

◆ MakeStrand()

IExecutorPtr yaclib::MakeStrand ( IExecutorPtr  e)

Strand is the asynchronous analogue of a mutex.

It guarantees that the tasks scheduled for it will be executed strictly sequentially. Strand itself does not have its own threads, it decorates another executor and uses it to run its tasks.

Parameters
eexecutor to decorate
Returns
pointer to new Strand instance
Examples
simple.cpp.

Definition at line 71 of file strand.cpp.

References MakeContract().

Referenced by TEST().

◆ MakeTask()

template<typename V = Unit, typename E = StopError, typename... Args>
auto yaclib::MakeTask ( Args &&...  args)

TODO(MBkkt) add description.

Definition at line 43 of file make.hpp.

References MakeContract().

◆ MakeUnique()

template<typename ObjectT , typename... Args>
auto yaclib::MakeUnique ( Args &&...  args)

Definition at line 27 of file helper.hpp.

References MakeContract().

◆ move_if()

template<bool Condition, typename T >
decltype(auto) yaclib::move_if ( T &&  arg)
noexcept

Definition at line 50 of file type_traits.hpp.

References MakeContract().

◆ On()

YACLIB_INLINE detail::OnAwaiter yaclib::On ( IExecutor e)
noexcept

TODO(mkornaukhov03) Add doxygen docs.

Definition at line 11 of file on.hpp.

References MakeContract().

◆ operator co_await() [1/2]

template<typename V , typename E >
YACLIB_INLINE auto yaclib::operator co_await ( FutureBase< V, E > &&  future)
noexcept

Definition at line 49 of file await.hpp.

References MakeContract(), and YACLIB_ASSERT.

◆ operator co_await() [2/2]

template<typename V , typename E >
YACLIB_INLINE auto yaclib::operator co_await ( Task< V, E > &&  task)
noexcept

Definition at line 55 of file await.hpp.

References MakeContract(), and YACLIB_ASSERT.

◆ operator!=() [1/5]

template<typename T , typename U >
bool yaclib::operator!= ( const IntrusivePtr< T > &  lhs,
const IntrusivePtr< U > &  rhs 
)
inlinenoexcept

Definition at line 69 of file intrusive_ptr.hpp.

References MakeContract().

◆ operator!=() [2/5]

template<typename T >
bool yaclib::operator!= ( const IntrusivePtr< T > &  lhs,
std::nullptr_t   
)
inlinenoexcept

Definition at line 104 of file intrusive_ptr.hpp.

References MakeContract().

◆ operator!=() [3/5]

template<typename T , typename U >
bool yaclib::operator!= ( const IntrusivePtr< T > &  lhs,
U rhs 
)
inlinenoexcept

Definition at line 79 of file intrusive_ptr.hpp.

References MakeContract().

◆ operator!=() [4/5]

template<typename T >
bool yaclib::operator!= ( std::nullptr_t  ,
const IntrusivePtr< T > &  rhs 
)
inlinenoexcept

Definition at line 109 of file intrusive_ptr.hpp.

References MakeContract().

◆ operator!=() [5/5]

template<typename T , typename U >
bool yaclib::operator!= ( T *  lhs,
const IntrusivePtr< U > &  rhs 
)
inlinenoexcept

Definition at line 89 of file intrusive_ptr.hpp.

References MakeContract().

◆ operator<()

template<typename T >
bool yaclib::operator< ( const IntrusivePtr< T > &  lhs,
const IntrusivePtr< T > &  rhs 
)
inlinenoexcept

Definition at line 114 of file intrusive_ptr.hpp.

References MakeContract().

◆ operator==() [1/5]

template<typename T , typename U >
bool yaclib::operator== ( const IntrusivePtr< T > &  lhs,
const IntrusivePtr< U > &  rhs 
)
inlinenoexcept

Definition at line 64 of file intrusive_ptr.hpp.

References yaclib::IntrusivePtr< T >::Get(), and MakeContract().

◆ operator==() [2/5]

template<typename T >
bool yaclib::operator== ( const IntrusivePtr< T > &  lhs,
std::nullptr_t   
)
inlinenoexcept

Definition at line 94 of file intrusive_ptr.hpp.

References MakeContract().

◆ operator==() [3/5]

template<typename T , typename U >
bool yaclib::operator== ( const IntrusivePtr< T > &  lhs,
U rhs 
)
inlinenoexcept

Definition at line 74 of file intrusive_ptr.hpp.

References MakeContract().

◆ operator==() [4/5]

template<typename T >
bool yaclib::operator== ( std::nullptr_t  ,
const IntrusivePtr< T > &  rhs 
)
inlinenoexcept

Definition at line 99 of file intrusive_ptr.hpp.

References MakeContract().

◆ operator==() [5/5]

template<typename T , typename U >
bool yaclib::operator== ( T *  lhs,
const IntrusivePtr< U > &  rhs 
)
inlinenoexcept

Definition at line 84 of file intrusive_ptr.hpp.

References MakeContract().

◆ Run() [1/2]

template<typename E = StopError, typename Func >
auto yaclib::Run ( Func &&  f)

Execute Callable func on Inline executor.

Parameters
ffunc to execute
Returns
Future corresponding f return value
Examples
simple.cpp, when_all.cpp, and when_any.cpp.

Definition at line 38 of file run.hpp.

References MakeContract(), and MakeInline().

Referenced by CalculatorService::Double(), CalculatorService::Increment(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ Run() [2/2]

template<typename E = StopError, typename Func >
auto yaclib::Run ( IExecutor e,
Func &&  f 
)

Execute Callable func on executor.

Parameters
eexecutor to be used to execute f and saved as callback executor for return Future
ffunc to execute
Returns
FutureOn corresponding f return value

Definition at line 50 of file run.hpp.

References yaclib::IExecutor::Inline, MakeContract(), and YACLIB_WARN.

◆ Schedule() [1/2]

template<typename E = StopError, typename Func >
auto yaclib::Schedule ( Func &&  f)

Execute Callable func on Inline executor.

Parameters
ffunc to execute
Returns
Future corresponding f return value

Definition at line 32 of file schedule.hpp.

References MakeContract(), and MakeInline().

◆ Schedule() [2/2]

template<typename E = StopError, typename Func >
auto yaclib::Schedule ( IExecutor e,
Func &&  f 
)

Execute Callable func on executor.

Parameters
eexecutor to be used to execute f and saved as callback executor for return Future
ffunc to execute
Returns
FutureOn corresponding f return value

Definition at line 44 of file schedule.hpp.

References yaclib::IExecutor::Inline, MakeContract(), and YACLIB_WARN.

◆ SetAtomicFailFrequency()

void yaclib::SetAtomicFailFrequency ( std::uint32_t  k)
noexcept

Sets frequency with which compare_exchange_weak would fail.

Default is 13

Definition at line 27 of file config.cpp.

References MakeContract(), and yaclib::detail::SetAtomicWeakFailFrequency().

◆ SetFaultFrequency()

void yaclib::SetFaultFrequency ( std::uint32_t  freq)
noexcept

Sets frequency with which fault will be injected.

Default is 16.

Definition at line 15 of file config.cpp.

References MakeContract(), and yaclib::detail::Injector::SetFrequency().

◆ SetFaultSleepTime()

void yaclib::SetFaultSleepTime ( std::uint32_t  ns)
noexcept

Sets sleep time if sleep is used instead of yield for interrupting thread execution for fault injection.

Default is 200

Definition at line 19 of file config.cpp.

References MakeContract(), and yaclib::detail::Injector::SetSleepTime().

◆ SetSeed()

void yaclib::SetSeed ( std::uint32_t  seed)
noexcept

Sets seed for random, which will be used when deciding when to yield, for fibers scheduler and random wrapper for tests.

Default is 1239.

Definition at line 33 of file config.cpp.

References MakeContract(), and yaclib::detail::SetSeed().

◆ Submit()

template<typename Func >
void yaclib::Submit ( IExecutor executor,
Func &&  f 
)

Submit given func for details.

See also
Submit

This method creates Job with one allocation and call Submit(Job)

Parameters
ffunc to execute

Definition at line 17 of file submit.hpp.

References MakeContract(), and yaclib::detail::MakeUniqueJob().

◆ UpCast() [1/2]

template<typename To , typename From , typename = std::enable_if_t<!std::is_pointer_v<From>>>
constexpr auto & yaclib::UpCast ( From &  from)
constexprnoexcept

Definition at line 21 of file cast.hpp.

References MakeContract().

◆ UpCast() [2/2]

template<typename To , typename From >
constexpr auto * yaclib::UpCast ( From *  from)
constexprnoexcept

Definition at line 9 of file cast.hpp.

References MakeContract().

◆ Wait() [1/3]

template<typename Event = detail::DefaultEvent, typename... V, typename... E>
YACLIB_INLINE void yaclib::Wait ( FutureBase< V, E > &...  fs)
noexcept

Wait until Ready becomes true.

Parameters
fsone or more futures to wait

Definition at line 18 of file wait.hpp.

References MakeContract(), and YACLIB_ASSERT.

Referenced by yaclib::FutureBase< V, E >::Get().

◆ Wait() [2/3]

template<typename Event = detail::DefaultEvent, typename It >
YACLIB_INLINE std::enable_if_t<!is_future_base_v< It >, void > yaclib::Wait ( It  begin,
It  end 
)
noexcept

Wait until Ready becomes true.

Parameters
beginiterator to futures to wait
enditerator to futures to wait

Definition at line 30 of file wait.hpp.

References MakeContract().

◆ Wait() [3/3]

template<typename Event = detail::DefaultEvent, typename It >
YACLIB_INLINE void yaclib::Wait ( It  begin,
std::size_t  count 
)
noexcept

Wait until Ready becomes true.

Parameters
beginiterator to futures to wait
countof futures to wait

Definition at line 43 of file wait.hpp.

References MakeContract().

◆ WaitFor() [1/3]

template<typename Event = detail::MutexEvent, typename Rep , typename Period , typename... V, typename... E>
YACLIB_INLINE bool yaclib::WaitFor ( const std::chrono::duration< Rep, Period > &  timeout_duration,
FutureBase< V, E > &...  fs 
)
noexcept

Wait until the specified timeout duration has elapsed or Ready becomes true.

The behavior is undefined if Valid is false before the call to this function. This function may block for longer than timeout_duration due to scheduling or resource contention delays.

Parameters
timeout_durationmaximum duration to block for
fsfutures to wait
Returns
The result of Ready upon exiting

Definition at line 23 of file wait_for.hpp.

References MakeContract(), and YACLIB_ASSERT.

◆ WaitFor() [2/3]

template<typename Event = detail::MutexEvent, typename Rep , typename Period , typename Iterator >
YACLIB_INLINE std::enable_if_t<!is_future_base_v< Iterator >, bool > yaclib::WaitFor ( const std::chrono::duration< Rep, Period > &  timeout_duration,
Iterator  begin,
Iterator  end 
)
noexcept

Wait until the specified timeout duration has elapsed or Ready becomes true.

The behavior is undefined if Valid is false before the call to this function. This function may block for longer than timeout_duration due to scheduling or resource contention delays.

Parameters
timeout_durationmaximum duration to block for
beginiterator to futures to wait
enditerator to futures to wait
Returns
The result of Ready upon exiting

Definition at line 40 of file wait_for.hpp.

References MakeContract().

◆ WaitFor() [3/3]

template<typename Event = detail::MutexEvent, typename Rep , typename Period , typename Iterator >
YACLIB_INLINE bool yaclib::WaitFor ( const std::chrono::duration< Rep, Period > &  timeout_duration,
Iterator  begin,
std::size_t  count 
)
noexcept

Wait until the specified timeout duration has elapsed or Ready becomes true.

The behavior is undefined if Valid is false before the call to this function. This function may block for longer than timeout_duration due to scheduling or resource contention delays.

Parameters
timeout_durationmaximum duration to block for
beginiterator to futures to wait
countof futures to wait
Returns
The result of Ready upon exiting

Definition at line 58 of file wait_for.hpp.

References MakeContract().

◆ WaitUntil() [1/3]

template<typename Event = detail::MutexEvent, typename Clock , typename Duration , typename... V, typename... E>
YACLIB_INLINE bool yaclib::WaitUntil ( const std::chrono::time_point< Clock, Duration > &  timeout_time,
FutureBase< V, E > &...  fs 
)
noexcept

Wait until specified time has been reached or Ready becomes true.

The behavior is undefined if Valid is false before the call to this function. This function may block for longer than until after timeout_time has been reached due to scheduling or resource contention delays.

Parameters
timeout_timemaximum time point to block until
fsfutures to wait
Returns
The result of Ready upon exiting

Definition at line 23 of file wait_until.hpp.

References MakeContract(), and YACLIB_ASSERT.

◆ WaitUntil() [2/3]

template<typename Event = detail::MutexEvent, typename Clock , typename Duration , typename Iterator >
YACLIB_INLINE std::enable_if_t<!is_future_base_v< Iterator >, bool > yaclib::WaitUntil ( const std::chrono::time_point< Clock, Duration > &  timeout_time,
Iterator  begin,
Iterator  end 
)
noexcept

Wait until specified time has been reached or Ready becomes true.

The behavior is undefined if Valid is false before the call to this function. This function may block for longer than until after timeout_time has been reached due to scheduling or resource contention delays.

Parameters
timeout_timemaximum time point to block until
beginiterator to futures to wait
enditerator to futures to wait
Returns
The result of Ready upon exiting

Definition at line 41 of file wait_until.hpp.

References MakeContract().

◆ WaitUntil() [3/3]

template<typename Event = detail::MutexEvent, typename Clock , typename Duration , typename Iterator >
YACLIB_INLINE bool yaclib::WaitUntil ( const std::chrono::time_point< Clock, Duration > &  timeout_time,
Iterator  begin,
std::size_t  count 
)
noexcept

Wait until specified time has been reached or Ready becomes true.

The behavior is undefined if Valid is false before the call to this function. This function may block for longer than until after timeout_time has been reached due to scheduling or resource contention delays.

Parameters
timeout_timemaximum time point to block until
beginiterator to futures to wait
countof futures to wait
Returns
The result of Ready upon exiting

Definition at line 60 of file wait_until.hpp.

References MakeContract().

◆ WhenAll() [1/3]

template<FailPolicy F = FailPolicy::FirstFail, OrderPolicy O = OrderPolicy::Fifo, typename V , typename... E>
auto yaclib::WhenAll ( FutureBase< V, E > &&...  futures)

Create Future which will be ready when all futures are ready.

Template Parameters
Vtype of value all passed futures
Etype of error all passed futures
Parameters
futurestwo or more futures to combine
Returns
Future<std::array<T>>

Definition at line 66 of file when_all.hpp.

References Error, LastFail, yaclib::detail::AllCombinator< O, R, E >::Make(), MakeContract(), and yaclib::detail::WhenImpl().

◆ WhenAll() [2/3]

template<FailPolicy F = FailPolicy::FirstFail, OrderPolicy O = OrderPolicy::Fifo, typename It , typename T = typename std::iterator_traits<It>::value_type>
YACLIB_INLINE auto yaclib::WhenAll ( It  begin,
It  end 
)

Create Future which will be ready when all futures are ready.

Template Parameters
Ittype of passed iterator
Ttype of all passed futures
Parameters
begin,endthe range of futures to combine
Returns
Future<std::vector<future_value_t<T>>, future_error_t<T>>

Definition at line 49 of file when_all.hpp.

References LastFail, and MakeContract().

◆ WhenAll() [3/3]

template<FailPolicy F = FailPolicy::FirstFail, OrderPolicy O = OrderPolicy::Fifo, typename It , typename T = typename std::iterator_traits<It>::value_type>
auto yaclib::WhenAll ( It  begin,
std::size_t  count 
)

Create Future which will be ready when all futures are ready.

Template Parameters
Ittype of passed iterator
Ttype of all passed futures
Parameters
begin,countthe range of futures to combine
Returns
Future<std::vector<future_value_t<T>>, future_error_t<T>>

Definition at line 27 of file when_all.hpp.

References LastFail, yaclib::detail::AllCombinator< O, R, E >::Make(), MakeContract(), yaclib::detail::WhenImpl(), and YACLIB_WARN.

◆ WhenAny() [1/3]

template<FailPolicy P = FailPolicy::LastFail, typename V , typename... E>
auto yaclib::WhenAny ( FutureBase< V, E > &&...  futures)

Create Future that is ready when any of futures is ready.

Template Parameters
Ppolicy WhenAny errors
Vtype of value all passed futures
Etype of error all passed futures
Parameters
futurestwo or more futures to combine
Returns
Future<T>

Definition at line 69 of file when_any.hpp.

References MakeContract(), and yaclib::detail::WhenImpl().

◆ WhenAny() [2/3]

template<FailPolicy P = FailPolicy::LastFail, typename It , typename T = typename std::iterator_traits<It>::value_type>
YACLIB_INLINE auto yaclib::WhenAny ( It  begin,
It  end 
)

Create Future that is ready when any of futures is ready.

Template Parameters
Ppolicy WhenAny errors
Ittype of passed iterator
Ttype of all passed futures
Parameters
begin,endthe range of futures to combine
Returns
Future<T>

Definition at line 52 of file when_any.hpp.

References MakeContract().

◆ WhenAny() [3/3]

template<FailPolicy P = FailPolicy::LastFail, typename It , typename T = typename std::iterator_traits<It>::value_type>
auto yaclib::WhenAny ( It  begin,
std::size_t  count 
)

Create Future that is ready when any of futures is ready.

Template Parameters
Ppolicy WhenAny errors
Ittype of passed iterator
Ttype of all passed futures
Parameters
begin,countthe range of futures to combine
Returns
Future<T>

Definition at line 26 of file when_any.hpp.

References yaclib::detail::AnyCombinator< V, E, P >::Make(), MakeContract(), yaclib::detail::WhenImpl(), and YACLIB_WARN.

◆ YACLIB_DEFINE_VOID_TYPE() [1/2]

yaclib::YACLIB_DEFINE_VOID_TYPE ( StopTag  )

◆ YACLIB_DEFINE_VOID_TYPE() [2/2]

yaclib::YACLIB_DEFINE_VOID_TYPE ( Unit  )

◆ Yield()

YACLIB_INLINE detail::CurrentAwaiter< true > yaclib::Yield ( )
noexcept

Instead of.

co_await yaclib::kYield;
auto& executor = co_await yaclib::Current();
constexpr detail::Yield kYield
Reschedule current job to it executor Useful for timeout checks, or if you job very big and doing onl...
Definition yield.hpp:32

or

auto& executor = co_await yaclib::kCurrent;
co_await On(executor);
YACLIB_INLINE detail::OnAwaiter On(IExecutor &e) noexcept
TODO(mkornaukhov03) Add doxygen docs.
Definition on.hpp:11

you can write auto& executor = co_await yaclib::Yield();

Definition at line 59 of file current_executor.hpp.

Variable Documentation

◆ is_future_base_v

template<typename T >
constexpr bool yaclib::is_future_base_v
inlineconstexpr
Initial value:
= detail::IsInstantiationOf<FutureBase, T>::Value ||
detail::IsInstantiationOf<Future, T>::Value ||
detail::IsInstantiationOf<FutureOn, T>::Value

Definition at line 37 of file type_traits.hpp.

◆ is_invocable_v

template<typename Func , typename... Arg>
constexpr bool yaclib::is_invocable_v = detail::IsInvocable<Func, Arg...>::Value
inlineconstexpr

Definition at line 16 of file type_traits.hpp.

◆ is_result_v

template<typename T >
constexpr bool yaclib::is_result_v = detail::IsInstantiationOf<Result, T>::Value
inlineconstexpr

Definition at line 22 of file type_traits.hpp.

◆ is_task_v

template<typename T >
constexpr bool yaclib::is_task_v = detail::IsInstantiationOf<Task, T>::Value
inlineconstexpr

Definition at line 41 of file type_traits.hpp.

◆ kYield

constexpr detail::Yield yaclib::kYield
inlineconstexpr

Reschedule current job to it executor Useful for timeout checks, or if you job very big and doing only cpu not suspend work.

Definition at line 32 of file yield.hpp.