Documentation ¶
Index ¶
- Constants
- type AtomicCounter
- type AtomicFlag
- type AtomicMask_
- type AtomicPool_
- type Parallel
- type Sink
- type Source
- func (zf Source) Chain(zx Source, eqt ...func(a, b reflect.Value) bool) Source
- func (zf Source) Collect() (r interface{}, err error)
- func (zf Source) Count() (count int, err error)
- func (zf Source) Drain(sink func(reflect.Value) error) (err error)
- func (zf Source) Filter(f interface{}) Source
- func (zf Source) First(n int) Source
- func (zf Source) LuckyCollect() interface{}
- func (zf Source) LuckyCount() int
- func (zf Source) Map(f interface{}) Source
- func (zf Source) Parallel(concurrency ...int) Source
- func (zf Source) Rand(seed int, prob float64) Source
- func (zf Source) RandFilter(seed int, prob float64, t bool) Source
- func (zf Source) RandSkip(seed int, prob float64) Source
- type Stream
- type WaitCounter
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
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 Source ¶
type Source func() Stream
func (Source) LuckyCollect ¶
func (zf Source) LuckyCollect() interface{}
func (Source) LuckyCount ¶
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
Click to show internal directories.
Click to hide internal directories.