rili::service::ComputeBase Class Reference
Inheritance diagram for rili::service::ComputeBase:
[legend]

Public Types

typedef std::exception_ptr FailureType
 

Public Member Functions

template<typename PromisedType >
rili::Promise< PromisedType > schedule (typename rili::Promise< PromisedType >::ComplexInitializer const &initializer) noexcept
 
template<typename PromisedType >
rili::Promise< PromisedType > schedule (typename rili::Promise< PromisedType >::BasicInitializer const &initializer) noexcept
 
rili::Promise< void > schedule (typename rili::Promise< void >::BasicInitializer const &initializer) noexcept
 
rili::Promise< void > schedule (typename rili::Promise< void >::ComplexInitializer const &initializer) noexcept
 

Detailed Description

User provided callback will be executed in another thread and returned rili::Promise will be resolved/rejected depending on user callback decision. In case when user callback will throw, returned rili::Promise will be rejected with thrown exception as a rejection reason.

Remarks
is interface class
See also
rili::service::Compute
rili::Promise
rili::Promise<void>

Member Typedef Documentation

typedef std::exception_ptr rili::service::ComputeBase::FailureType

is type in which all kinds of rejections / exceptions are stored (same like in rili::Promise)

Member Function Documentation

template<typename PromisedType >
rili::Promise<PromisedType> rili::service::ComputeBase::schedule ( typename rili::Promise< PromisedType >::ComplexInitializer const &  initializer)
inlinenoexcept

used to run user callback in another thread context.

Callback will be called with parameters "resolve" and "reject" (same like in rili::Promise::Promise(ComplexInitializer const&)). When resolve will be called then returned rili::Promise will be resolved with given value. When reject will be called then returned rili::Promise will be rejected with given value. If initializer throws then returned rili::Promise will be rejected with thrown exception as rejection reason.

Parameters
initializeris function which is executed to resolve or reject rili::Promise. It provide as first parameter another function which can be used to resolve rili::Promise and as second function which can be used to reject rili::Promise.
Remarks
This function is thread safe.
This function is not blocking.
Returns
rili::Promise related to compute task
template<typename PromisedType >
rili::Promise<PromisedType> rili::service::ComputeBase::schedule ( typename rili::Promise< PromisedType >::BasicInitializer const &  initializer)
inlinenoexcept

used to run user callback in another thread context.

Callback will be called with parameter "resolve" (same like in rili::Promise::Promise(BasicInitializer const&)). When resolve will be called then returned rili::Promise will be resolved with given value. If initializer throws then returned rili::Promise will be rejected with thrown exception as rejection reason.

Parameters
initializeris function which is executed to resolve rili::Promise. It provide as parameter another function which can be used to resolve rili::Promise.
Remarks
This function is thread safe.
This function is not blocking.
Returns
rili::Promise related to compute task
rili::Promise<void> rili::service::ComputeBase::schedule ( typename rili::Promise< void >::BasicInitializer const &  initializer)
noexcept

used to run user callback in another thread context.

Callback will be called with parameter "resolve" (same like in rili::Promise<void>::Promise(BasicInitializer const&)). When resolve will be called then returned rili::Promise<void> will be resolved. If initializer throws then returned rili::Promise<void> will be rejected with thrown exception as rejection reason.

Parameters
initializeris function which is executed to resolve rili::Promise<void>. It provide as parameter another function which can be used to resolve rili::Promise<void>.
Remarks
This function is thread safe.
This function is not blocking.
Returns
rili::Promise<void> related to compute task
rili::Promise<void> rili::service::ComputeBase::schedule ( typename rili::Promise< void >::ComplexInitializer const &  initializer)
noexcept

used to run user callback in another thread context.

Callback will be called with parameters "resolve" and "reject" (same like in rili::Promise<void>::Promise(ComplexInitializer const&)). When resolve will be called then returned rili::Promise<void> will be resolved with given value. When reject will be called then returned rili::Promise<void> will be rejected with given value. If initializer throws then returned rili::Promise<void> will be rejected with thrown exception as rejection reason.

Parameters
initializeris function which is executed to resolve or reject rili::Promise<void>. It provide as first parameter another function which can be used to resolve rili::Promise<void> and as second function which can be used to reject rili::Promise<void>.
Remarks
This function is thread safe.
This function is not blocking.
Returns
rili::Promise<void> related to compute task

The documentation for this class was generated from the following file: