Provides asynchronous resolution. More...
#include <event_engine.h>
Classes | |
struct | LookupTaskHandle |
Task handle for DNS Resolution requests. More... | |
struct | ResolverOptions |
Optional configuration for DNSResolvers. More... | |
struct | SRVRecord |
DNS SRV record type. More... | |
Public Types | |
using | LookupHostnameCallback = std::function< void(absl::StatusOr< std::vector< ResolvedAddress > >)> |
using | LookupSRVCallback = std::function< void(absl::StatusOr< std::vector< SRVRecord > >)> |
Called with a collection of SRV records. More... | |
using | LookupTXTCallback = std::function< void(absl::StatusOr< std::string >)> |
Called with the result of a TXT record lookup. More... | |
Public Member Functions | |
virtual bool | CancelLookup (LookupTaskHandle handle)=0 |
virtual LookupTaskHandle | LookupHostname (LookupHostnameCallback on_resolve, absl::string_view name, absl::string_view default_port, Duration timeout)=0 |
virtual LookupTaskHandle | LookupSRV (LookupSRVCallback on_resolve, absl::string_view name, Duration timeout)=0 |
virtual LookupTaskHandle | LookupTXT (LookupTXTCallback on_resolve, absl::string_view name, Duration timeout)=0 |
virtual | ~DNSResolver ()=default |
Provides asynchronous resolution.
Definition at line 289 of file event_engine.h.
using grpc_event_engine::experimental::EventEngine::DNSResolver::LookupHostnameCallback = std::function<void(absl::StatusOr<std::vector<ResolvedAddress> >)> |
Called with the collection of sockaddrs that were resolved from a given target address.
Definition at line 311 of file event_engine.h.
using grpc_event_engine::experimental::EventEngine::DNSResolver::LookupSRVCallback = std::function<void(absl::StatusOr<std::vector<SRVRecord> >)> |
Called with a collection of SRV records.
Definition at line 314 of file event_engine.h.
using grpc_event_engine::experimental::EventEngine::DNSResolver::LookupTXTCallback = std::function<void(absl::StatusOr<std::string>)> |
Called with the result of a TXT record lookup.
Definition at line 316 of file event_engine.h.
|
virtualdefault |
|
pure virtual |
Cancel an asynchronous lookup operation.
This shares the same semantics with EventEngine::Cancel: successfully cancelled lookups will not have their callbacks executed, and this method returns true.
Implemented in grpc_event_engine::experimental::IomgrEventEngine::IomgrDNSResolver.
|
pure virtual |
Asynchronously resolve an address.
default_port may be a non-numeric named service port, and will only be used if address does not already contain a port component.
When the lookup is complete, the on_resolve callback will be invoked with a status indicating the success or failure of the lookup. Implementations should pass the appropriate statuses to the callback. For example, callbacks might expect to receive DEADLINE_EXCEEDED or NOT_FOUND.
If cancelled, on_resolve will not be executed.
Implemented in grpc_event_engine::experimental::IomgrEventEngine::IomgrDNSResolver.
|
pure virtual |
Asynchronously perform an SRV record lookup.
on_resolve has the same meaning and expectations as LookupHostname's on_resolve callback.
Implemented in grpc_event_engine::experimental::IomgrEventEngine::IomgrDNSResolver.
|
pure virtual |
Asynchronously perform a TXT record lookup.
on_resolve has the same meaning and expectations as LookupHostname's on_resolve callback.
Implemented in grpc_event_engine::experimental::IomgrEventEngine::IomgrDNSResolver.