util

package
v0.0.0-...-de4c1f9 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: LGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package util contains miscellaneous utilities used by yggdrasil. In particular, this includes a crypto worker pool, Cancellation machinery, and a sync.Pool used to reuse []byte.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuncTimeout

func FuncTimeout(timeout time.Duration, f func()) bool

FuncTimeout runs the provided function in a separate goroutine, and returns true if the function finishes executing before the timeout passes, or false if the timeout passes. It includes no mechanism to stop the function if the timeout fires, so the user is expected to do so on their own (such as with a Cancellation or a context).

func TimerStop

func TimerStop(t *time.Timer) bool

TimerStop stops a timer and makes sure the channel is drained, returns true if the timer was stopped before firing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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