hk

package
v1.3.19 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

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

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

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

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

Index

Constants

View Source
const (
	DelOldIval      = 8 * time.Minute // hk interval: cleanup old
	PruneActiveIval = 2 * time.Minute // hk interval: prune active

	OldAgeLso      = time.Minute      // when list-objects is considered old
	OldAgeLsoNotif = 10 * time.Second // notifications-wise
	OldAgeX        = time.Hour        // all other X
)
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 DefaultHK *housekeeper

Functions

func Init

func Init(stopping *atomic.Bool)

func Reg

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

func TestInit

func TestInit()

func Unreg

func Unreg(name string)

func WaitStarted

func WaitStarted()

Types

type Action

type Action interface {
	fmt.Stringer
	Housekeep() time.Duration
}

type CleanupFunc

type CleanupFunc = func() time.Duration

Jump to

Keyboard shortcuts

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