Starts a Timeout that is invoked only once after expiration (relative) time has passed. More...
#include <Async.h>
Public Types | |
using | CompletionData = AsyncCompletionData |
Completion data for AsyncLoopTimeout. More... | |
using | Result = AsyncResultOf< AsyncLoopTimeout, CompletionData > |
Callback result for AsyncLoopTimeout. More... | |
Public Types inherited from SC::AsyncRequest | |
enum class | Type : uint8_t { LoopTimeout , LoopWakeUp , LoopWork , ProcessExit , SocketAccept , SocketConnect , SocketSend , SocketReceive , SocketClose , FileRead , FileWrite , FileClose , FilePoll } |
Type of async request. More... | |
Public Member Functions | |
SC::Result | start (AsyncEventLoop &eventLoop, Time::Milliseconds relativeTimeout) |
Starts a Timeout that is invoked (only once) after the specific relative expiration time has passed. More... | |
Public Member Functions inherited from SC::AsyncRequest | |
void | setDebugName (const char *newDebugName) |
AsyncEventLoop * | getEventLoop () const |
Get the event loop associated with this AsyncRequest. More... | |
void | cacheInternalEventLoop (AsyncEventLoop &loop) |
Caches the event loop associated with this AsyncRequest. More... | |
AsyncRequest (Type type) | |
Constructs a free async request of given type. More... | |
Result | stop () |
Stops the async operation. More... | |
bool | isFree () const |
Public Attributes | |
Function< void(Result &)> | callback |
Called after given expiration time since AsyncLoopTimeout::start has passed. More... | |
Time::Milliseconds | relativeTimeout |
Timer expiration (relative) time in milliseconds. More... | |
Public Attributes inherited from SC::AsyncRequest | |
AsyncRequest * | next = nullptr |
AsyncRequest * | prev = nullptr |
Friends | |
struct | AsyncEventLoop |
Additional Inherited Members | |
Protected Member Functions inherited from SC::AsyncRequest | |
Result | validateAsync () |
Result | queueSubmission (AsyncEventLoop &eventLoop) |
Result | queueSubmission (AsyncEventLoop &eventLoop, ThreadPool &threadPool, AsyncTask &task) |
Protected Attributes inherited from SC::AsyncRequest | |
AsyncEventLoop * | eventLoop = nullptr |
AsyncTask * | asyncTask = nullptr |
Starts a Timeout that is invoked only once after expiration (relative) time has passed.
Completion data for AsyncLoopTimeout.
Callback result for AsyncLoopTimeout.
SC::Result SC::AsyncLoopTimeout::start | ( | AsyncEventLoop & | eventLoop, |
Time::Milliseconds | relativeTimeout | ||
) |
Starts a Timeout that is invoked (only once) after the specific relative expiration time has passed.
eventLoop | The event loop where queuing this async request |
relativeTimeout | Relative time in milliseconds after which callback will be called |
Called after given expiration time since AsyncLoopTimeout::start has passed.
Time::Milliseconds SC::AsyncLoopTimeout::relativeTimeout |
Timer expiration (relative) time in milliseconds.