#include <oracle_event_engine_posix.h>
Classes | |
class | ReadOperation |
class | WriteOperation |
Public Member Functions | |
EventEngine::ResolvedAddress & | GetLocalAddress () const override |
EventEngine::ResolvedAddress & | GetPeerAddress () const override |
PosixOracleEndpoint (int socket_fd) | |
void | Read (std::function< void(absl::Status)> on_read, SliceBuffer *buffer, const ReadArgs *args) override |
void | Shutdown () |
void | Write (std::function< void(absl::Status)> on_writable, SliceBuffer *data, const WriteArgs *args) override |
~PosixOracleEndpoint () override | |
![]() | |
virtual | ~Endpoint ()=default |
Static Public Member Functions | |
static std::unique_ptr< PosixOracleEndpoint > | Create (int socket_fd) |
Private Member Functions | |
grpc_core::Thread read_ops_ | ABSL_GUARDED_BY (mu_) |
grpc_core::Thread write_ops_ | ABSL_GUARDED_BY (mu_) |
void | ProcessReadOperations () |
void | ProcessWriteOperations () |
Private Attributes | |
bool | is_shutdown_ = false |
absl::Mutex | mu_ |
Promise< ReadOperation > | read_ops_channel_ |
int | socket_fd_ |
Promise< WriteOperation > | write_ops_channel_ |
Definition at line 40 of file oracle_event_engine_posix.h.
|
explicit |
Definition at line 190 of file oracle_event_engine_posix.cc.
|
override |
Definition at line 224 of file oracle_event_engine_posix.cc.
|
private |
|
private |
|
static |
Definition at line 219 of file oracle_event_engine_posix.cc.
|
inlineoverridevirtual |
Implements grpc_event_engine::experimental::EventEngine::Endpoint.
Definition at line 53 of file oracle_event_engine_posix.h.
|
inlineoverridevirtual |
Returns an address in the format described in DNSResolver. The returned values are expected to remain valid for the life of the Endpoint.
Implements grpc_event_engine::experimental::EventEngine::Endpoint.
Definition at line 50 of file oracle_event_engine_posix.h.
|
private |
Definition at line 245 of file oracle_event_engine_posix.cc.
|
private |
Definition at line 266 of file oracle_event_engine_posix.cc.
|
overridevirtual |
Reads data from the Endpoint.
When data is available on the connection, that data is moved into the buffer, and the on_read callback is called. The caller must ensure that the callback has access to the buffer when executed later. Ownership of the buffer is not transferred. Valid slices may be placed into the buffer even if the callback is invoked with a non-OK Status.
There can be at most one outstanding read per Endpoint at any given time. An outstanding read is one in which the on_read callback has not yet been executed for some previous call to Read. If an attempt is made to call Read while a previous read is still outstanding, the EventEngine must abort.
For failed read operations, implementations should pass the appropriate statuses to on_read. For example, callbacks might expect to receive CANCELLED on endpoint shutdown.
Implements grpc_event_engine::experimental::EventEngine::Endpoint.
Definition at line 229 of file oracle_event_engine_posix.cc.
void grpc_event_engine::experimental::PosixOracleEndpoint::Shutdown | ( | ) |
Definition at line 208 of file oracle_event_engine_posix.cc.
|
overridevirtual |
Writes data out on the connection.
on_writable is called when the connection is ready for more data. The Slices within the data buffer may be mutated at will by the Endpoint until on_writable is called. The data SliceBuffer will remain valid after calling Write, but its state is otherwise undefined. All bytes in data must have been written before calling on_writable unless an error has occurred.
There can be at most one outstanding write per Endpoint at any given time. An outstanding write is one in which the on_writable callback has not yet been executed for some previous call to Write. If an attempt is made to call Write while a previous write is still outstanding, the EventEngine must abort.
For failed write operations, implementations should pass the appropriate statuses to on_writable. For example, callbacks might expect to receive CANCELLED on endpoint shutdown.
Implements grpc_event_engine::experimental::EventEngine::Endpoint.
Definition at line 239 of file oracle_event_engine_posix.cc.
Definition at line 110 of file oracle_event_engine_posix.h.
|
mutableprivate |
Definition at line 109 of file oracle_event_engine_posix.h.
|
private |
Definition at line 112 of file oracle_event_engine_posix.h.
|
private |
Definition at line 111 of file oracle_event_engine_posix.h.
|
private |
Definition at line 113 of file oracle_event_engine_posix.h.