hk

package
v1.3.13 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 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) 2018-2021, NVIDIA CORPORATION. All rights reserved.

Index

Constants

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