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
// IsRunning returns true iff the function is running.
IsRunning() bool
}
One is an object that will allow to run only one function at a time.
Click to show internal directories.
Click to hide internal directories.