An AsyncBaseOp represents a pending operation. You may set a notification callback or you may use this class's methods directly.

Synopsis

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

class AsyncBaseOp;

Description

The op must remain allocated until it is completed or canceled.

Type Aliases

Name

Description

NotificationCallback

Callback invoked when the operation completes.

Enums

Name

Description

State

Lifecycle state of an operation.

Member Functions

Name

Description

AsyncBaseOp [constructor]

Constructors

~AsyncBaseOp [destructor] [virtual]

Destroy the operation.

operator= [deleted]

Deleted copy assignment.

getAsyncIOOp [virtual]

Return this operation as an AsyncIOOp, if it is one.

getIoUringOp [virtual]

Return this operation as an IoUringOp, if it is one.

getNotificationCallback

Get the notification callback from the op.

getUserData

user data get/set

pread

pread overloads

preadv [virtual]

Initiate a vectored read request.

pwrite

pwrite overloads

pwritev [virtual]

Initiate a vectored write request.

reset [virtual]

Reset the operation for reuse. It is an error to call reset() on an Op that is still pending.

result

Retrieve the result of this operation. Returns >=0 on success, ‐errno on failure (that is, using the Linux kernel error reporting conventions). Use checkKernelError (folly/Exception.h) on the result to throw a std::system_error in case of error instead.

setNotificationCallback

Set the callback invoked when the operation completes.

setUserData

Associate an opaque user data pointer with this operation.

state

Return the current operation state.

toStream [virtual]

Write a human‐readable description of this operation to the stream.

Static Member Functions

Name

Description

fd2name

Return a human‐readable name for the given file descriptor.

Protected Member Functions

Name

Description

cancel

Mark the operation as canceled.

complete

Mark the operation as completed with the given result.

init

Initialize the operation.

start

Mark the operation as started.

unstart

Revert the operation from the started state.

Protected Data Members

Name

Description

cb_

Completion callback.

result_

Result of the completed operation.

state_

Current lifecycle state.

userData_

Opaque user data pointer.

Friends

Name

Description

folly::AsyncBase

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

Derived Classes

Name

Description

AsyncIOOp

A pending operation backed by the Linux io_submit interface.

Created with MrDocs