idle

package
v1.69.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enforcer

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

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

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager implements idleness detection and calls the configured Enforcer to enter/exit idle mode when appropriate. Must be created by NewManager.

func NewManager

func NewManager(enforcer Enforcer, timeout time.Duration) *Manager

NewManager creates a new idleness manager implementation for the given idle timeout. It begins in idle mode.

func (*Manager) Close

func (m *Manager) Close()

Close stops the timer associated with the Manager, if it exists.

func (*Manager) EnterIdleModeForTesting added in v1.60.0

func (m *Manager) EnterIdleModeForTesting()

EnterIdleModeForTesting instructs the channel to enter idle mode.

func (*Manager) ExitIdleMode added in v1.60.0

func (m *Manager) ExitIdleMode() error

ExitIdleMode instructs m to call the enforcer's ExitIdleMode and update m's internal state.

func (*Manager) OnCallBegin

func (m *Manager) OnCallBegin() error

OnCallBegin is invoked at the start of every RPC.

func (*Manager) OnCallEnd

func (m *Manager) OnCallEnd()

OnCallEnd is invoked at the end of every RPC.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL