atomic

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicBool

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

AtomicBool is a boolean representation that is synchronized for cross-goroutine use in multiple ways Initial value is always false

func (*AtomicBool) Do

func (b *AtomicBool) Do(f func(value bool) bool)

Do will unconditionally execute a function (f), giving the current value to that function and setting the new value to whatever the function returns

func (*AtomicBool) DoIf

func (b *AtomicBool) DoIf(value bool, f func() bool)

DoIf will execute a function (f) only if the value of the boolean is equal to the value provided, setting the new value to whatever the function returns

func (*AtomicBool) Get

func (b *AtomicBool) Get() bool

Get retrieves the current value

func (*AtomicBool) GetAndSet

func (b *AtomicBool) GetAndSet(newValue bool) (oldValue bool)

GetAndSet will set a new value and return the prior value

func (*AtomicBool) Set

func (b *AtomicBool) Set(value bool)

Set sets a new value

type AtomicWork

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

AtomicWork is a synchronized FIFO queue for work

func (*AtomicWork) GetRemainingCount

func (w *AtomicWork) GetRemainingCount() int

func (*AtomicWork) GetWork

func (w *AtomicWork) GetWork() *loadtest.TestContext

Pop pulls the next work item from the front of the queue, returning nil if no more work is available

func (*AtomicWork) Push

func (w *AtomicWork) Push(context loadtest.TestContext)

Push adds more work to the end of the queue

func (*AtomicWork) PushMulti

func (w *AtomicWork) PushMulti(contexts []loadtest.TestContext)

PushMulti adds multiple work items to the end of the queue

func (*AtomicWork) WorkRemaining

func (w *AtomicWork) WorkRemaining() bool

Jump to

Keyboard shortcuts

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