idle

package
v2.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Timer

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

Timer keeps track of the request activity and notifies registered channels once an idle timeout has been reached.

func NewTimer

func NewTimer(timeout time.Duration, notificationChan chan struct{}) *Timer

NewTimer creates a new Timer that will send notifications on any registered channels once the idle timeout has been reached.

func (*Timer) ResetTimer

func (t *Timer) ResetTimer()

ResetTimer resets the idle timer countdown. It should be called once at the start of every new request.

func (*Timer) Start

func (t *Timer) Start()

Start begins the idle timer, and returns immediately.

Jump to

Keyboard shortcuts

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