GRPC Core
9.0.0
|
Interface for name resolution. More...
#include <resolver.h>
Data Structures | |
struct | Result |
Results returned by the resolver. More... | |
class | ResultHandler |
A proxy object used by the resolver to return results to the client channel. More... | |
Public Member Functions | |
Resolver (const Resolver &)=delete | |
Resolver & | operator= (const Resolver &)=delete |
virtual | ~Resolver () |
virtual void | StartLocked ()=0 |
Starts resolving. More... | |
virtual void | RequestReresolutionLocked () |
Asks the resolver to obtain an updated resolver result, if applicable. More... | |
virtual void | ResetBackoffLocked () |
Resets the re-resolution backoff, if any. More... | |
void | Orphan () override |
![]() | |
InternallyRefCounted (const InternallyRefCounted &)=delete | |
InternallyRefCounted & | operator= (const InternallyRefCounted &)=delete |
![]() | |
Orphanable (const Orphanable &)=delete | |
Orphanable & | operator= (const Orphanable &)=delete |
Protected Member Functions | |
Resolver (Combiner *combiner, std::unique_ptr< ResultHandler > result_handler) | |
Does NOT take ownership of the reference to combiner. More... | |
virtual void | ShutdownLocked ()=0 |
Shuts down the resolver. More... | |
Combiner * | combiner () const |
ResultHandler * | result_handler () const |
![]() | |
InternallyRefCounted (TraceFlagT *trace_flag=nullptr, intptr_t initial_refcount=1) | |
virtual | ~InternallyRefCounted ()=default |
RefCountedPtr< Resolver > | Ref () GRPC_MUST_USE_RESULT |
RefCountedPtr< Resolver > | Ref (const DebugLocation &location, const char *reason) GRPC_MUST_USE_RESULT |
void | Unref () |
void | Unref (const DebugLocation &location, const char *reason) |
![]() | |
Orphanable () | |
virtual | ~Orphanable () |
Interface for name resolution.
This interface is designed to support both push-based and pull-based mechanisms. A push-based mechanism is one where the resolver will subscribe to updates for a given name, and the name service will proactively send new data to the resolver whenever the data associated with the name changes. A pull-based mechanism is one where the resolver needs to query the name service again to get updated information (e.g., DNS).
Note: All methods with a "Locked" suffix must be called from the combiner passed to the constructor.
|
delete |
|
virtual |
|
explicitprotected |
Does NOT take ownership of the reference to combiner.
|
inlineprotected |
|
inlineoverridevirtual |
Implements grpc_core::Orphanable.
|
inlinevirtual |
Asks the resolver to obtain an updated resolver result, if applicable.
This is useful for pull-based implementations to decide when to re-resolve. However, the implementation is not required to re-resolve immediately upon receiving this call; it may instead elect to delay based on some configured minimum time between queries, to avoid hammering the name service with queries.
For push-based implementations, this may be a no-op.
Note: Implementations must not invoke any method on the ResultHandler from within this call.
Reimplemented in grpc_core::FakeResolver.
|
inlinevirtual |
Resets the re-resolution backoff, if any.
This needs to be implemented only by pull-based implementations; for push-based implementations, it will be a no-op. TODO(roth): Pull the backoff code out of resolver and into client_channel, so that it can be shared across resolver implementations. At that point, this method can go away.
|
inlineprotected |
|
protectedpure virtual |
Shuts down the resolver.
|
pure virtual |
Starts resolving.
Implemented in grpc_core::FakeResolver.