package idle

import "google.golang.org/grpc/internal/idle"

Package idle contains a component for managing idleness (entering and exiting) based on RPC activity.

Index

Types

type Enforcer

type Enforcer interface {
	ExitIdleMode() error
	EnterIdleMode() error
}

Enforcer is the functionality provided by grpc.ClientConn to enter and exit from idle mode.

type Manager

type Manager interface {
	OnCallBegin() error
	OnCallEnd()
	Close()
}

Manager defines the functionality required to track RPC activity on a channel.

func NewManager

func NewManager(opts ManagerOptions) Manager

NewManager creates a new idleness manager implementation for the given idle timeout.

type ManagerOptions

type ManagerOptions struct {
	Enforcer Enforcer
	Timeout  time.Duration
	Logger   grpclog.LoggerV2
}

ManagerOptions is a collection of options used by NewManager.

Source Files

idle.go

Version
v1.58.3
Published
Oct 10, 2023
Platform
windows/amd64
Imports
6 packages
Last checked
15 minutes ago

Tools for package owners.