Generic C++ interface around Linux IO(io_submit, io_uring)

Synopsis

Declared in <folly/io/async/AsyncBase.h>

class AsyncBase;

Type Aliases

Name

Description

Op

The operation type managed by this context.

Enums

Name

Description

PollMode

Whether the context exposes a pollable completion file descriptor.

Member Functions

Name

Description

AsyncBase [constructor]

Constructors

~AsyncBase [destructor] [virtual]

Destroy the context.

operator= [deleted]

Deleted copy assignment.

cancel

Cancel all pending requests and return them; the returned range is valid until the next call to cancel().

capacity

Return the maximum number of requests that can be kept outstanding at any one time.

initializeContext [virtual]

Initialize context

pending

Return the number of pending requests.

pollCompleted

If POLLABLE, call instead of wait after the file descriptor returned by pollFd() became readable. The returned range is valid until the next call to pollCompleted().

pollFd

If POLLABLE, return a file descriptor that can be passed to poll / epoll and will become readable when any async IO operations have completed. If NOT_POLLABLE, return ‐1.

submit

submit overloads

totalSubmits

Return the accumulative number of submitted I/O, since this object has been created.

wait

Wait for at least minRequests to complete. Returns the requests that have completed; the returned range is valid until the next call to wait(). minRequests may be 0 to not block.

Protected Enums

Name

Description

WaitType

Whether a wait should collect completed or canceled operations.

Protected Member Functions

Name

Description

cancel

Mark an operation as canceled.

complete

Mark an operation as completed with the given result.

decrementPending

Decrease the pending request count by the given amount.

doWait [virtual]

Wait for operations to complete or be canceled.

drainPollFd [virtual]

Drain readiness notifications from the poll file descriptor.

isInit

Return whether the context has been initialized.

submitOne [virtual]

Submit a single operation to the underlying backend.

submitRange [virtual]

Submit a range of operations to the underlying backend.

Protected Data Members

Name

Description

canceled_

Buffer of canceled operations.

capacity_

Maximum concurrent pending requests.

completed_

Buffer of completed operations.

initMutex_

Guards initialization.

init_

Whether the context is initialized.

pending_

Number of pending requests.

pollFd_

Completion file descriptor, or ‐1.

pollMode_

Configured poll mode.

submitted_

Total number of submitted requests.

Derived Classes

Name

Description

AsyncIO

C++ interface around Linux Async IO.

Created with MrDocs