Go to the documentation of this file.
24 #include <type_traits>
47 return "TRANSIENT_FAILURE";
64 const std::shared_ptr<WorkSerializer>& work_serializer)
66 if (work_serializer !=
nullptr) {
72 grpc_schedule_on_exec_ctx);
81 gpr_log(
GPR_INFO,
"watcher %p: delivering async notification for %s (%s)",
83 self->status_.ToString().c_str());
85 self->watcher_->OnConnectivityStateChange(
self->state_,
self->status_);
107 state_.load(std::memory_order_relaxed);
112 "ConnectivityStateTracker %s[%p]: notifying watcher %p: %s -> %s",
128 state_.load(std::memory_order_relaxed);
129 if (initial_state != current_state) {
132 "ConnectivityStateTracker %s[%p]: notifying watcher %p: %s -> %s",
148 gpr_log(
GPR_INFO,
"ConnectivityStateTracker %s[%p]: remove watcher %p",
156 const char* reason) {
158 state_.load(std::memory_order_relaxed);
159 if (
state == current_state)
return;
161 gpr_log(
GPR_INFO,
"ConnectivityStateTracker %s[%p]: %s -> %s (%s, %s)",
170 "ConnectivityStateTracker %s[%p]: notifying watcher %p: %s -> %s",
184 gpr_log(
GPR_INFO,
"ConnectivityStateTracker %s[%p]: get current state: %s",
#define GRPC_CLOSURE_INIT(closure, cb, cb_arg, scheduler)
void RemoveWatcher(ConnectivityStateWatcherInterface *watcher)
absl::Status status() const
std::string ToString(StatusToStringMode mode=StatusToStringMode::kDefault) const
void Notify(grpc_connectivity_state new_state, const absl::Status &status) final
std::shared_ptr< WorkSerializer > work_serializer_
@ GRPC_CHANNEL_TRANSIENT_FAILURE
void AddWatcher(grpc_connectivity_state initial_state, OrphanablePtr< ConnectivityStateWatcherInterface > watcher)
TraceFlag grpc_connectivity_state_trace(false, "connectivity_state")
std::map< ConnectivityStateWatcherInterface *, OrphanablePtr< ConnectivityStateWatcherInterface > > watchers_
#define GRPC_TRACE_FLAG_ENABLED(f)
grpc_connectivity_state state() const
void SetState(grpc_connectivity_state state, const absl::Status &status, const char *reason)
std::atomic< grpc_connectivity_state > state_
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
RefCountedPtr< ConnectivityStateWatcherInterface > Ref() GRPC_MUST_USE_RESULT
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
static void SendNotification(void *arg, grpc_error_handle)
RefCountedPtr< AsyncConnectivityStateWatcherInterface > watcher_
@ GRPC_CHANNEL_CONNECTING
const char * ConnectivityStateName(grpc_connectivity_state state)
std::unique_ptr< T, Deleter > OrphanablePtr
static void Run(const DebugLocation &location, grpc_closure *closure, grpc_error_handle error)
const absl::Status status_
Notifier(RefCountedPtr< AsyncConnectivityStateWatcherInterface > watcher, grpc_connectivity_state state, const absl::Status &status, const std::shared_ptr< WorkSerializer > &work_serializer)
const grpc_connectivity_state state_
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END intern self
~ConnectivityStateTracker()
grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:01