package idle
Import Path
google.golang.org/grpc/internal/idle (on go.dev)
Dependency Relation
imports 4 packages, and imported by one package
Involved Source Files
Package idle contains a component for managing idleness (entering and exiting)
based on RPC activity.
Package-Level Type Names (total 2)
ClientConn is the functionality provided by grpc.ClientConn to enter and exit
from idle mode.
( ClientConn) EnterIdleMode()
( ClientConn) ExitIdleMode()
func NewManager(cc ClientConn, timeout time.Duration) *Manager
Manager implements idleness detection and calls the ClientConn to enter/exit
idle mode when appropriate. Must be created by NewManager.
Close stops the timer associated with the Manager, if it exists.
EnterIdleModeForTesting instructs the channel to enter idle mode.
ExitIdleMode instructs m to call the ClientConn's ExitIdleMode and update its
internal state.
OnCallBegin is invoked at the start of every RPC.
OnCallEnd is invoked at the end of every RPC.
UnsafeSetNotIdle instructs the Manager to update its internal state to
reflect the reality that the channel is no longer in IDLE mode.
N.B. This method is intended only for internal use by the gRPC client
when it exits IDLE mode **manually** from `Dial`. The callsite must ensure:
- The channel was **actually in IDLE mode** immediately prior to the call.
- There is **no concurrent activity** that could cause the channel to exit
IDLE mode *naturally* at the same time.
func NewManager(cc ClientConn, timeout time.Duration) *Manager
Package-Level Functions (only one)
NewManager creates a new idleness manager implementation for the
given idle timeout. It begins in idle mode.
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |