#include <grpc/support/port_platform.h>
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include <inttypes.h>
#include "absl/status/status.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/pollset.h"
#include "src/core/lib/iomgr/pollset_set.h"
#include "src/core/lib/iomgr/timer.h"
#define DEFAULT_POLL_INTERVAL_MS …
namespace {
struct backup_poller { … };
}
static gpr_mu g_poller_mu;
static backup_poller* g_poller = …;
static grpc_core::Duration g_poll_interval = …;
GPR_GLOBAL_CONFIG_DEFINE_INT32(
grpc_client_channel_backup_poll_interval_ms, DEFAULT_POLL_INTERVAL_MS,
"Declares the interval in ms between two backup polls on client channels. "
"These polls are run in the timer thread so that gRPC can process "
"connection failures while there is no active polling thread. "
"They help reconnect disconnected client channels (mostly due to "
"idleness), so that the next RPC on this channel won't fail. Set to 0 to "
"turn off the backup polls.");
void grpc_client_channel_global_init_backup_polling() { … }
static void backup_poller_shutdown_unref(backup_poller* p) { … }
static void done_poller(void* arg, grpc_error_handle ) { … }
static void g_poller_unref() { … }
static void run_poller(void* arg, grpc_error_handle error) { … }
static void g_poller_init_locked() { … }
void grpc_client_channel_start_backup_polling(
grpc_pollset_set* interested_parties) { … }
void grpc_client_channel_stop_backup_polling(
grpc_pollset_set* interested_parties) { … }