util

package
v0.0.0-...-7fe9760 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ManageFdLimit

func ManageFdLimit() (changed bool, newLimit uint64, err error)

managefdlimit提高当前最大文件描述符计数 基于ipfs_fd_max值的过程

func SetupInterruptHandler

func SetupInterruptHandler(ctx context.Context) (io.Closer, context.Context)

Types

type IntrHandler

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

IntrHandler帮助设置一个中断处理程序,可以 通过IO.Closer接口彻底关闭。

func NewIntrHandler

func NewIntrHandler() *IntrHandler

func (*IntrHandler) Close

func (ih *IntrHandler) Close() error

func (*IntrHandler) Handle

func (ih *IntrHandler) Handle(handler func(count int, ih *IntrHandler), sigs ...os.Signal)

句柄开始处理给定的信号,并将调用该句柄 每次捕获信号时回调函数。函数被传递 处理程序被触发的总次数,如 以及处理程序本身,以便处理逻辑可以使用 处理程序的等待组,以确保在调用close()时干净关闭。

Jump to

Keyboard shortcuts

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