Schedules and runs asynchronous work.

Synopsis

Declared in <folly/Executor.h>

class Executor;

Type Aliases

Name

Description

KeepAlive

Alias for ExecutorKeepAlive, a safe pointer to an Executor.

Member Functions

Name

Description

~Executor [destructor] [virtual]

Destroys the executor.

add [virtual]

Enqueue a function to be executed by this executor. This and all variants must be threadsafe.

addWithPriority [virtual]

Enqueue a function with a given priority, where 0 is the medium priority This is up to the implementation to enforce

getNumPriorities [virtual]

Returns the number of priority levels this executor supports.

Static Member Functions

Name

Description

getKeepAliveToken

getKeepAliveToken overloads

invokeCatchingExns

Invokes f, logging and swallowing any exception it throws.

Static Data Members

Name

Description

HI_PRI

Highest schedulable priority.

LO_PRI

Lowest schedulable priority.

MID_PRI

Medium (default) schedulable priority.

Protected Member Functions

Name

Description

keepAliveAcquire [virtual]

Acquire a keep alive token. Should return false if keep‐alive mechanism is not supported.

keepAliveRelease [virtual]

Release a keep alive token previously acquired by keepAliveAcquire(). Will never be called if keepAliveAcquire() returns false.

Protected Static Member Functions

Name

Description

isKeepAliveDummy

Returns true if the KeepAlive is constructed from an executor that does not support the keep alive ref‐counting functionality

keepAliveAcquire

Acquires a keep‐alive reference on executor.

keepAliveRelease

Releases a keep‐alive reference on executor.

makeKeepAlive

Makes a counted (non‐dummy, non‐alias) keep‐alive referring to executor.

Friends

Name

Description

folly::ExecutorKeepAlive

ExecutorKeepAlive is a safe pointer to an Executor.

Non-Member Functions

Name

Description

getCPUExecutor

methodset Deprecated

getUnsafeMutableGlobalCPUExecutor

methodset Executors

async_tracing::logFutureVia

Trace hook invoked when a Future is rescheduled onto an executor.

async_tracing::logGetGlobalCPUExecutor

Trace hook invoked when the global CPU executor is retrieved.

async_tracing::logGetImmutableCPUExecutor

Trace hook invoked when the immutable CPU executor is retrieved.

async_tracing::logSemiFutureVia

Trace hook invoked when a SemiFuture is rescheduled onto an executor.

async_tracing::logSetGlobalCPUExecutor

Trace hook invoked when the global CPU executor is set.

Derived Classes

Name

Description

DefaultKeepAliveExecutor

An Executor accepts units of work with add(), which should be threadsafe.

DrivableExecutor

An executor that can be driven forward via its drive() method.

FiberManager

Single‐threaded task execution engine.

IOExecutor

An executor backed by an I/O event loop.

InlineLikeExecutor

Base class for executors that run queued work inline.

ScheduledExecutor

An executor that supports timed scheduling. Like RxScheduler.

SequencedExecutor

An executor that sequences tasks whose submissions were sequenced.

SoftRealTimeExecutor

Executor that performs priority‐based scheduling with a deadline assigned to each task.

ThreadedExecutor

* ThreadedExecutor

WeakRefExecutor

Marker base for the weak‐reference executor wrappers.

Created with MrDocs