idle

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: Apache-2.0 Imports: 2 Imported by: 4

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) *Timer

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

func (*Timer) Register

func (t *Timer) Register(c chan struct{})

Register adds a channel that will be notified once the idle timeout is 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