service

package
v0.2300.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package sync provides sync primitives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type One

type One interface {
	// TryStart starts the function iff no other is running.
	TryStart(func(context.Context)) bool

	// TryStop stops the running function, if any. This method blocks until
	// the function finishes its work.
	TryStop() bool
}

One is an object that will allow to run only one function at a time.

func NewOne

func NewOne() One

NewOne creates an object which will allow to run only one function at a time.

Jump to

Keyboard shortcuts

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