Go to the documentation of this file.
61 "grpc_channel_check_connectivity_state(channel=%p, try_to_connect=%d)", 2,
68 if (grpc_core::IsLameChannel(
channel)) {
72 "grpc_channel_check_connectivity_state called on something that is "
73 "not a client channel");
83 if (client_channel ==
nullptr) {
84 if (!grpc_core::IsLameChannel(
channel)) {
86 "grpc_channel_num_external_connectivity_watchers called on "
87 "something that is not a client channel");
102 class StateWatcher :
public DualRefCounted<StateWatcher> {
110 state_(last_observed_state) {
114 ClientChannel* client_channel =
116 if (client_channel ==
nullptr) {
122 if (IsLameChannel(
channel_.get())) {
128 "grpc_channel_watch_connectivity_state called on "
129 "something that is not a client channel");
136 auto* watcher_timer_init_state =
new WatcherTimerInitState(
138 client_channel->AddExternalConnectivityWatcher(
146 class WatcherTimerInitState {
148 WatcherTimerInitState(StateWatcher* state_watcher,
Timestamp deadline)
157 auto*
self =
static_cast<WatcherTimerInitState*
>(
arg);
158 self->state_watcher_->StartTimer(
self->deadline_);
172 auto*
self =
static_cast<StateWatcher*
>(
arg);
181 auto*
self =
static_cast<StateWatcher*
>(
arg);
184 ClientChannel* client_channel =
186 if (client_channel !=
nullptr) {
187 client_channel->CancelExternalConnectivityWatcher(&
self->on_complete_);
193 void Orphan()
override {
197 "Timed out waiting for connection state change")
205 auto*
self =
static_cast<StateWatcher*
>(
arg);
233 "grpc_channel_watch_connectivity_state("
234 "channel=%p, last_observed_state=%d, "
235 "deadline=gpr_timespec { tv_sec: %" PRId64
236 ", tv_nsec: %d, clock_type: %d }, "
241 new grpc_core::StateWatcher(
channel,
cq,
tag, last_observed_state, deadline);
static ClientChannel * GetFromChannel(Channel *channel)
#define GRPC_CLOSURE_INIT(closure, cb, cb_arg, scheduler)
grpc_completion_queue * cq_
void grpc_channel_watch_connectivity_state(grpc_channel *channel, grpc_connectivity_state last_observed_state, gpr_timespec deadline, grpc_completion_queue *cq, void *tag)
int NumExternalConnectivityWatchers() const
static const grpc_channel_filter kFilter
grpc_connectivity_state grpc_channel_check_connectivity_state(grpc_channel *c_channel, int try_to_connect)
@ GRPC_CHANNEL_TRANSIENT_FAILURE
void grpc_cq_end_op(grpc_completion_queue *cq, void *tag, grpc_error_handle error, void(*done)(void *done_arg, grpc_cq_completion *storage), void *done_arg, grpc_cq_completion *storage, bool internal)
#define GRPC_LOG_IF_ERROR(what, error)
#define GRPC_TRACE_FLAG_ENABLED(f)
grpc_connectivity_state CheckConnectivityState(bool try_to_connect)
grpc_channel_element * grpc_channel_stack_last_element(grpc_channel_stack *channel_stack)
wrapped_grpc_channel * channel
static void * tag(intptr_t t)
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
grpc_polling_entity grpc_polling_entity_create_from_pollset(grpc_pollset *pollset)
grpc_pollset * grpc_cq_pollset(grpc_completion_queue *cq)
RefCountedPtr< Channel > channel_
#define GRPC_ERROR_CREATE_FROM_STATIC_STRING(desc)
gpr_clock_type clock_type
void grpc_timer_cancel(grpc_timer *timer)
bool grpc_cq_begin_op(grpc_completion_queue *cq, void *tag)
#define GRPC_ERROR_REF(err)
grpc_core::ExecCtx exec_ctx
int grpc_channel_support_connectivity_watcher(grpc_channel *channel)
void grpc_timer_init(grpc_timer *timer, grpc_core::Timestamp deadline, grpc_closure *closure)
grpc_connectivity_state state_
struct grpc_channel grpc_channel
StateWatcher * state_watcher_
grpc_core::TraceFlag grpc_trace_operation_failures(false, "op_failure")
grpc_closure on_complete_
static Timestamp FromTimespecRoundUp(gpr_timespec t)
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END intern self
internal::RefMatcher< T & > Ref(T &x)
static Channel * FromC(grpc_channel *c_type)
grpc_cq_completion completion_storage_
static grpc_completion_queue * cq
#define GRPC_API_TRACE(fmt, nargs, args)
int grpc_channel_num_external_connectivity_watchers(grpc_channel *c_channel)
#define GRPC_ERROR_IS_NONE(err)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:52