Public Member Functions | List of all members
grpc_event_engine::experimental::PosixOracleEventEngine Class Referencefinal

#include <oracle_event_engine_posix.h>

Inheritance diagram for grpc_event_engine::experimental::PosixOracleEventEngine:
Inheritance graph
[legend]

Public Member Functions

bool Cancel (TaskHandle) override
 
bool CancelConnect (ConnectionHandle) override
 
ConnectionHandle Connect (OnConnectCallback on_connect, const ResolvedAddress &addr, const EndpointConfig &args, MemoryAllocator memory_allocator, EventEngine::Duration timeout) override
 
absl::StatusOr< std::unique_ptr< Listener > > CreateListener (Listener::AcceptCallback on_accept, std::function< void(absl::Status)> on_shutdown, const EndpointConfig &, std::unique_ptr< MemoryAllocatorFactory > memory_allocator_factory) override
 
std::unique_ptr< DNSResolverGetDNSResolver (const DNSResolver::ResolverOptions &) override
 
bool IsWorkerThread () override
 
 PosixOracleEventEngine ()=default
 
void Run (Closure *) override
 
void Run (std::function< void()>) override
 
TaskHandle RunAfter (EventEngine::Duration, Closure *) override
 
TaskHandle RunAfter (EventEngine::Duration, std::function< void()>) override
 
 ~PosixOracleEventEngine () override=default
 
- Public Member Functions inherited from grpc_event_engine::experimental::EventEngine
virtual ConnectionHandle Connect (OnConnectCallback on_connect, const ResolvedAddress &addr, const EndpointConfig &args, MemoryAllocator memory_allocator, Duration timeout)=0
 
virtual std::unique_ptr< DNSResolverGetDNSResolver (const DNSResolver::ResolverOptions &options)=0
 
virtual TaskHandle RunAfter (Duration when, Closure *closure)=0
 
virtual TaskHandle RunAfter (Duration when, std::function< void()> closure)=0
 
virtual ~EventEngine ()=default
 

Additional Inherited Members

- Public Types inherited from grpc_event_engine::experimental::EventEngine
using Duration = std::chrono::duration< int64_t, std::nano >
 
using OnConnectCallback = std::function< void(absl::StatusOr< std::unique_ptr< Endpoint > >)>
 

Detailed Description

Definition at line 142 of file oracle_event_engine_posix.h.

Constructor & Destructor Documentation

◆ PosixOracleEventEngine()

grpc_event_engine::experimental::PosixOracleEventEngine::PosixOracleEventEngine ( )
default

◆ ~PosixOracleEventEngine()

grpc_event_engine::experimental::PosixOracleEventEngine::~PosixOracleEventEngine ( )
overridedefault

Member Function Documentation

◆ Cancel()

bool grpc_event_engine::experimental::PosixOracleEventEngine::Cancel ( TaskHandle  handle)
inlineoverridevirtual

Request cancellation of a task.

If the associated closure has already been scheduled to run, it will not be cancelled, and this function will return false.

If the associated callback has not been scheduled to run, it will be cancelled, and the associated std::function or Closure* will not be executed. In this case, Cancel will return true.

Implementation note: closures should be destroyed in a timely manner after execution or cancelliation (milliseconds), since any state bound to the closure may need to be destroyed for things to progress (e.g., if a closure holds a ref to some ref-counted object).

Implements grpc_event_engine::experimental::EventEngine.

Definition at line 186 of file oracle_event_engine_posix.h.

◆ CancelConnect()

bool grpc_event_engine::experimental::PosixOracleEventEngine::CancelConnect ( ConnectionHandle  handle)
inlineoverridevirtual

Request cancellation of a connection attempt.

If the associated connection has already been completed, it will not be cancelled, and this method will return false.

If the associated connection has not been completed, it will be cancelled, and this method will return true. The OnConnectCallback will not be called.

Implements grpc_event_engine::experimental::EventEngine.

Definition at line 164 of file oracle_event_engine_posix.h.

◆ Connect()

EventEngine::ConnectionHandle grpc_event_engine::experimental::PosixOracleEventEngine::Connect ( OnConnectCallback  on_connect,
const ResolvedAddress addr,
const EndpointConfig args,
MemoryAllocator  memory_allocator,
EventEngine::Duration  timeout 
)
override

Definition at line 421 of file oracle_event_engine_posix.cc.

◆ CreateListener()

absl::StatusOr<std::unique_ptr<Listener> > grpc_event_engine::experimental::PosixOracleEventEngine::CreateListener ( Listener::AcceptCallback  on_accept,
std::function< void(absl::Status)>  on_shutdown,
const EndpointConfig config,
std::unique_ptr< MemoryAllocatorFactory memory_allocator_factory 
)
inlineoverridevirtual

Factory method to create a network listener / server.

Once a Listener is created and started, the on_accept callback will be called once asynchronously for each established connection. This method may return a non-OK status immediately if an error was encountered in any synchronous steps required to create the Listener. In this case, on_shutdown will never be called.

If this method returns a Listener, then on_shutdown will be invoked exactly once, when the Listener is shut down. The status passed to it will indicate if there was a problem during shutdown.

The provided MemoryAllocatorFactory is used to create MemoryAllocators for Endpoint construction.

Implements grpc_event_engine::experimental::EventEngine.

Definition at line 147 of file oracle_event_engine_posix.h.

◆ GetDNSResolver()

std::unique_ptr<DNSResolver> grpc_event_engine::experimental::PosixOracleEventEngine::GetDNSResolver ( const DNSResolver::ResolverOptions &  )
inlineoverride

Definition at line 168 of file oracle_event_engine_posix.h.

◆ IsWorkerThread()

bool grpc_event_engine::experimental::PosixOracleEventEngine::IsWorkerThread ( )
inlineoverridevirtual

◆ Run() [1/2]

void grpc_event_engine::experimental::PosixOracleEventEngine::Run ( Closure closure)
inlineoverridevirtual

Asynchronously executes a task as soon as possible.

Closures scheduled with Run cannot be cancelled. The closure will not be deleted after it has been run, ownership remains with the caller.

Implements grpc_event_engine::experimental::EventEngine.

Definition at line 172 of file oracle_event_engine_posix.h.

◆ Run() [2/2]

void grpc_event_engine::experimental::PosixOracleEventEngine::Run ( std::function< void()>  closure)
inlineoverridevirtual

Asynchronously executes a task as soon as possible.

Closures scheduled with Run cannot be cancelled. Unlike the overloaded Closure alternative, the std::function version's closure will be deleted by the EventEngine after the closure has been run.

This version of Run may be less performant than the Closure version in some scenarios. This overload is useful in situations where performance is not a critical concern.

Implements grpc_event_engine::experimental::EventEngine.

Definition at line 175 of file oracle_event_engine_posix.h.

◆ RunAfter() [1/2]

TaskHandle grpc_event_engine::experimental::PosixOracleEventEngine::RunAfter ( EventEngine::Duration  ,
Closure  
)
inlineoverride

Definition at line 178 of file oracle_event_engine_posix.h.

◆ RunAfter() [2/2]

TaskHandle grpc_event_engine::experimental::PosixOracleEventEngine::RunAfter ( EventEngine::Duration  ,
std::function< void()>   
)
inlineoverride

Definition at line 182 of file oracle_event_engine_posix.h.


The documentation for this class was generated from the following files:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:40