ExecutorKeepAlive is a safe pointer to an Executor.
Synopsis
Declared in <folly/Executor.h>
template<typename ExecutorT = Executor>
class ExecutorKeepAlive;
Description
For any Executor that supports keep‐alive functionality, its destructor will block until all the ExecutorKeepAlive objects associated with that executor are destroyed. For executors that don't support the keep‐alive functionality, ExecutorKeepAlive doesn't provide such protection.
ExecutorKeepAlive should always be used instead of Executor*. ExecutorKeepAlive can be implicitly constructed from Executor*.
The getKeepAliveToken() helper can be used to construct a keep‐alive in templated code if you need to preserve the original executor type.
Type Aliases
Name |
Description |
A callable that consumes an rvalue keep‐alive to this executor. |
Member Functions
Name |
Description |
|
Constructors |
|
Releases the referenced executor keep‐alive, if any. |
Assignment operators |
|
Enqueues |
|
Returns a new keep‐alive that shares this token's executor. |
|
Returns the referenced executor, or nullptr if empty. |
|
Returns an alias keep‐alive whose lifetime is assumed to be surrounded by this one. |
|
Returns a reference to the referenced executor. |
|
Returns a pointer to the referenced executor. |
|
Releases the referenced executor keep‐alive and empties this token. |
|
Returns true if this token refers to an executor. |
Friends
Name |
Description |
|
|
Schedules and runs asynchronous work. |
Non-Member Functions
Name |
Description |
Created with MrDocs