lazy

package
v0.0.0-...-f9355b5 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const STOP = math.MaxUint64

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicCounter

type AtomicCounter struct {
	Value uint64
}

AtomicCounter - hm, yes it's atomic counter

func (*AtomicCounter) Dec

func (c *AtomicCounter) Dec() uint64

Dec decrements counter and returns NEW value

func (*AtomicCounter) PostInc

func (c *AtomicCounter) PostInc() uint64

PostInc increments counter and returns OLD value

type AtomicFlag

type AtomicFlag struct {
	Value int32
}

AtomicFlag - hm, yes it's atomic flag

func (*AtomicFlag) Clear

func (c *AtomicFlag) Clear() (r bool)

Clear switches Integer to 0 atomically

func (*AtomicFlag) Set

func (c *AtomicFlag) Set() (r bool)

Set switches Integer to 1 atomically

func (*AtomicFlag) State

func (c *AtomicFlag) State() bool

State returns current state

type AtomicMask_

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

func AtomicMask

func AtomicMask(width int) *AtomicMask_

func ExtendableAtomicMask

func ExtendableAtomicMask(canextend func(int) bool) *AtomicMask_

func (*AtomicMask_) FinCallForAll

func (a *AtomicMask_) FinCallForAll(f func(no int))

func (*AtomicMask_) Lock

func (a *AtomicMask_) Lock() int

func (*AtomicMask_) Unlock

func (a *AtomicMask_) Unlock(i int)

type AtomicPool_

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

func AtomicPool

func AtomicPool(acquire func(no int) interface{}) *AtomicPool_

func (*AtomicPool_) Allocate

func (a *AtomicPool_) Allocate() (interface{}, int)

func (*AtomicPool_) Close

func (a *AtomicPool_) Close()

func (*AtomicPool_) Release

func (a *AtomicPool_) Release(n int)

type Parallel

type Parallel int

type Sink

type Sink func(reflect.Value) error

type Source

type Source func() Stream

func Chan

func Chan(c interface{}, stop ...chan struct{}) Source

func List

func List(list interface{}) Source

func (Source) Chain

func (zf Source) Chain(zx Source, eqt ...func(a, b reflect.Value) bool) Source

func (Source) Collect

func (zf Source) Collect() (r interface{}, err error)

func (Source) Count

func (zf Source) Count() (count int, err error)

func (Source) Drain

func (zf Source) Drain(sink func(reflect.Value) error) (err error)

func (Source) Filter

func (zf Source) Filter(f interface{}) Source

func (Source) First

func (zf Source) First(n int) Source

func (Source) LuckyCollect

func (zf Source) LuckyCollect() interface{}

func (Source) LuckyCount

func (zf Source) LuckyCount() int

func (Source) Map

func (zf Source) Map(f interface{}) Source

func (Source) Parallel

func (zf Source) Parallel(concurrency ...int) Source

func (Source) Rand

func (zf Source) Rand(seed int, prob float64) Source

func (Source) RandFilter

func (zf Source) RandFilter(seed int, prob float64, t bool) Source

func (Source) RandSkip

func (zf Source) RandSkip(seed int, prob float64) Source

type Stream

type Stream func(index uint64) (reflect.Value, error)

func Error

func Error(err error, z ...Stream) Stream

func Wrap

func Wrap(e interface{}) Stream

type WaitCounter

type WaitCounter struct {
	Value uint64
	// contains filtered or unexported fields
}

WaitCounter implements barrier counter for lazy flow execution synchronization

func (*WaitCounter) Inc

func (c *WaitCounter) Inc() (r bool)

PostInc increments index and notifies waiting goroutines

func (*WaitCounter) Stop

func (c *WaitCounter) Stop()

Stop sets Integer to ~uint64(0) and notifies waiting goroutines. It means also counter will not increment more

func (*WaitCounter) Stopped

func (c *WaitCounter) Stopped() bool

Stopped returns true if counter is stopped and will not increment more

func (*WaitCounter) Wait

func (c *WaitCounter) Wait(index uint64) (r bool)

Wait waits until counter Integer is not equal to specified index

Jump to

Keyboard shortcuts

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