utils

package
v1.7.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package utils provides various utility functions.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAlreadyRunning is the error that is returned when runner is already running/closing/closed.
	ErrAlreadyRunning = errors.New("runner is already running/closing/closed")
	// ErrNotRunning is the error that is returned when runner is not running/closing/closed.
	ErrNotRunning = errors.New("runner is not running/closing/closed")
)

Functions

This section is empty.

Types

type Runner

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

Runner is a fn/stop runner.

func NewRunner

func NewRunner(fn, stop func() error, retryStop func(error) bool) *Runner

NewRunner creates a new runner.

func (*Runner) Run

func (r *Runner) Run() error

Run runs fn.

func (*Runner) Stop

func (r *Runner) Stop() error

Stop stops runner. It's safe to call even if runner is already stopped or in process of being stopped.

Jump to

Keyboard shortcuts

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