inactivity

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseClientConn

func CloseClientConn(cc ClientConn)

Types

type ClientConn

type ClientConn = interface {
	Context() context.Context
	Close() error
}

type KeepAlive

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

func NewKeepAlive

func NewKeepAlive(maxRetries uint32, onInactive OnInactiveFunc, sendPing func(cc ClientConn, receivePong func()) (func(), error)) *KeepAlive

func (*KeepAlive) OnInactive

func (m *KeepAlive) OnInactive(cc ClientConn)

type Monitor

type Monitor = interface {
	CheckInactivity(now time.Time, cc ClientConn)
	Notify()
}

func NewInactivityMonitor

func NewInactivityMonitor(duration time.Duration, onInactive OnInactiveFunc) Monitor

func NewNilMonitor

func NewNilMonitor() Monitor

type OnInactiveFunc

type OnInactiveFunc = func(cc ClientConn)

Jump to

Keyboard shortcuts

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