hk

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package hk provides mechanism for registering cleanup functions which are invoked at specified intervals.

  • Copyright (c) 2023-2025, NVIDIA CORPORATION. All rights reserved.

Package hk provides mechanism for registering cleanup functions which are invoked at specified intervals.

  • Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.

Package hk provides mechanism for registering cleanup functions which are invoked at specified intervals.

  • Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.

Package hk provides mechanism for registering cleanup functions which are invoked at specified intervals.

  • Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.

Index

Constants

View Source
const (
	// hk timers
	DelOldIval        = 24 * time.Minute // cleanup old xactions; old transactions
	Prune2mIval       = 2 * time.Minute  // prune active xactions (from finished); cleanup notifs; remove aged idle SDM recv
	PruneRateLimiters = 6 * time.Hour    // prune stale rate limiters on the front

	//
	// when things are getting _old_
	//
	OldAgeXshort   = time.Minute      // x-lso, x-moss
	OldAgeX        = time.Hour        // all other xactions
	OldAgeNotif    = 3 * time.Minute  // old notifications
	OldAgeNotifLso = 10 * time.Second // note: seconds
)
View Source
const (
	DayInterval   = 24 * time.Hour
	UnregInterval = 365 * DayInterval // to unregister upon return from the callback
)
View Source
const NameSuffix = ".gc" // reg name suffix

Variables

View Source
var HK *hk

singleton

Functions

func Init

func Init(mustRun bool)

func Jitter added in v1.4.1

func Jitter(d time.Duration, now int64) time.Duration

add +/-3% pseudo-random jitter to the housekeeping interval `d`

func Reg

func Reg(name string, f HKCB, interval time.Duration)

func Unreg

func Unreg(name string)

func UnregIf added in v1.3.24

func UnregIf(name string, f HKCB)

non-presence is fine

func WaitStarted

func WaitStarted()

Types

type HKCB added in v1.3.30

type HKCB func(now int64) time.Duration

Jump to

Keyboard shortcuts

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