safe

package
v0.0.0-...-d8b0a59 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Go

func Go(goroutine func())

Go starts a recoverable goroutine.

func GoWithRecover

func GoWithRecover(goroutine func(), customRecover func(err any))

GoWithRecover starts a recoverable goroutine using given customRecover() function.

func OperationWithRecover

func OperationWithRecover(operation backoff.Operation) backoff.Operation

OperationWithRecover wrap a backoff operation in a Recover.

Types

type Pool

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

Pool is a pool of go routines.

func NewPool

func NewPool(parentCtx context.Context) *Pool

NewPool creates a Pool.

func (*Pool) GoCtx

func (p *Pool) GoCtx(goroutine routineCtx)

GoCtx starts a recoverable goroutine with a context.

func (*Pool) Stop

func (p *Pool) Stop()

Stop stops all started routines, waiting for their termination.

type Safe

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

Safe contains a thread-safe value.

func New

func New(value any) *Safe

New create a new Safe instance given a value.

func (*Safe) Get

func (s *Safe) Get() any

Get returns the value.

func (*Safe) Set

func (s *Safe) Set(value any)

Set sets a new value.

Jump to

Keyboard shortcuts

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