#include <iomgr_engine.h>
Classes | |
struct | ClosureData |
class | IomgrDNSResolver |
class | IomgrEndpoint |
class | IomgrListener |
Private Member Functions | |
TaskHandleSet known_handles_ | ABSL_GUARDED_BY (mu_) |
EventEngine::TaskHandle | RunAfterInternal (Duration when, std::function< void()> cb) |
grpc_core::Timestamp | ToTimestamp (EventEngine::Duration when) |
Private Attributes | |
std::atomic< intptr_t > | aba_token_ {0} |
grpc_core::Mutex | mu_ |
iomgr_engine::ThreadPool | thread_pool_ {2} |
iomgr_engine::TimerManager | timer_manager_ |
Additional Inherited Members | |
![]() | |
using | Duration = std::chrono::duration< int64_t, std::nano > |
using | OnConnectCallback = std::function< void(absl::StatusOr< std::unique_ptr< Endpoint > >)> |
Definition at line 45 of file iomgr_engine.h.
grpc_event_engine::experimental::IomgrEventEngine::IomgrEventEngine | ( | ) |
Definition at line 69 of file iomgr_engine.cc.
|
override |
Definition at line 71 of file iomgr_engine.cc.
|
private |
|
overridevirtual |
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 84 of file iomgr_engine.cc.
|
overridevirtual |
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 138 of file iomgr_engine.cc.
|
overridevirtual |
Creates a client network connection to a remote network listener.
Even in the event of an error, it is expected that the on_connect callback will be asynchronously executed exactly once by the EventEngine. A connection attempt can be cancelled using the CancelConnect method.
Implementation Note: it is important that the memory_allocator be used for all read/write buffer allocations in the EventEngine implementation. This allows gRPC's ResourceQuota system to monitor and control memory usage with graceful degradation mechanisms. Please see the MemoryAllocator API for more information.
Implements grpc_event_engine::experimental::EventEngine.
Definition at line 142 of file iomgr_engine.cc.
|
overridevirtual |
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 150 of file iomgr_engine.cc.
|
override |
Definition at line 129 of file iomgr_engine.cc.
|
overridevirtual |
Implements grpc_event_engine::experimental::EventEngine.
Definition at line 134 of file iomgr_engine.cc.
|
overridevirtual |
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 108 of file iomgr_engine.cc.
|
overridevirtual |
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 104 of file iomgr_engine.cc.
|
overridevirtual |
Synonymous with scheduling an alarm to run after duration when.
The closure will execute when time when arrives unless it has been cancelled via the Cancel method. If cancelled, the closure will not be run, nor will it be deleted. Ownership remains with the caller.
Implements grpc_event_engine::experimental::EventEngine.
Definition at line 99 of file iomgr_engine.cc.
|
overridevirtual |
Synonymous with scheduling an alarm to run after duration when.
The closure will execute when time when arrives unless it has been cancelled via the Cancel method. If cancelled, the closure will not be run. Unilke the overloaded Closure alternative, the std::function version's closure will be deleted by the EventEngine after the closure has been run, or upon cancellation.
This version of RunAfter 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 94 of file iomgr_engine.cc.
|
private |
Definition at line 112 of file iomgr_engine.cc.
|
private |
Definition at line 44 of file iomgr_engine.cc.
|
private |
Definition at line 116 of file iomgr_engine.h.
|
private |
Definition at line 114 of file iomgr_engine.h.
|
private |
Definition at line 112 of file iomgr_engine.h.
|
private |
Definition at line 111 of file iomgr_engine.h.