udwSync

package
v0.0.0-...-f254aa5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsChannelClosed

func IsChannelClosed(err error) bool

func SendToChannel

func SendToChannel(send func())

Types

type Bool

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

func NewBool

func NewBool(s bool) *Bool

func (*Bool) Get

func (s *Bool) Get() bool

func (*Bool) Set

func (s *Bool) Set(v bool)

type BoolWaiter

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

func (*BoolWaiter) Get

func (bw *BoolWaiter) Get() bool

func (*BoolWaiter) Set

func (bw *BoolWaiter) Set(b bool)

func (*BoolWaiter) Wait

func (bw *BoolWaiter) Wait(needStatus bool)

func (*BoolWaiter) WaitTrueWithTimeout

func (bw *BoolWaiter) WaitTrueWithTimeout(dur time.Duration) bool

func (*BoolWaiter) WaitWithTimeout

func (bw *BoolWaiter) WaitWithTimeout(needStatus bool, dur time.Duration) bool

type Broadcast

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

func NewBroadcast

func NewBroadcast() *Broadcast

func (*Broadcast) Broadcast

func (b *Broadcast) Broadcast()

func (*Broadcast) WaitWithCb

func (b *Broadcast) WaitWithCb(fn func() bool)

func (*Broadcast) WaitWithVersion

func (b *Broadcast) WaitWithVersion(v int) int

type Cond

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

func (*Cond) Broadcast

func (c *Cond) Broadcast()

func (*Cond) Close

func (c *Cond) Close()

func (*Cond) InLock

func (c *Cond) InLock(f func())

func (*Cond) InLockAndSignal

func (c *Cond) InLockAndSignal(f func())

func (*Cond) Signal

func (c *Cond) Signal()

func (*Cond) WaitCheck

func (c *Cond) WaitCheck(isTrue func() bool)

func (*Cond) WaitCheckAndDo

func (c *Cond) WaitCheckAndDo(isTrue func() bool, doAfterTrue func())

type InitOnceWithError

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

func (*InitOnceWithError) Do

func (once *InitOnceWithError) Do(fn func() (errS string)) (errS string)

func (*InitOnceWithError) HasInitSucc

func (once *InitOnceWithError) HasInitSucc() bool

type Int

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

func NewInt

func NewInt(s int) *Int

func (*Int) Add

func (s *Int) Add(toAdd int)

func (*Int) AddAndReturnNew

func (s *Int) AddAndReturnNew(toAdd int) int

func (*Int) Dec

func (s *Int) Dec()

func (*Int) Get

func (s *Int) Get() int

func (*Int) Inc

func (s *Int) Inc()

func (*Int) Set

func (s *Int) Set(v int)

type MapStringString

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

func (*MapStringString) Get

func (m *MapStringString) Get(k string) string

func (*MapStringString) Set

func (m *MapStringString) Set(k string, v string)

type MemoryObjectPool

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

func NewMemoryObjectPool

func NewMemoryObjectPool(req MemoryObjectPoolRequest) *MemoryObjectPool

func (*MemoryObjectPool) Go

func (pool *MemoryObjectPool) Go(job func(obj interface{}))

type MemoryObjectPoolEntry

type MemoryObjectPoolEntry struct {
	Obj interface{}
}

type MemoryObjectPoolRequest

type MemoryObjectPoolRequest struct {
	MaxEntryNumber int
	NewObjectFn    func() interface{}
}

type MemoryObjectPoolWithCpuNumber

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

func (*MemoryObjectPoolWithCpuNumber) Go

func (pool2 *MemoryObjectPoolWithCpuNumber) Go(job func(entry *MemoryObjectPoolEntry))

type NumIdAlloc

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

func (*NumIdAlloc) AllocId

func (alloc *NumIdAlloc) AllocId() int

func (*NumIdAlloc) MustFreeId

func (alloc *NumIdAlloc) MustFreeId(id int)

type OneInstance

type OneInstance struct {
	Name string
	// contains filtered or unexported fields
}

func (*OneInstance) IsRun

func (oi *OneInstance) IsRun() (isRun bool)

func (*OneInstance) MustRun

func (oi *OneInstance) MustRun(fn func())

func (*OneInstance) MustStart

func (oi *OneInstance) MustStart()

func (*OneInstance) MustStop

func (oi *OneInstance) MustStop()

func (*OneInstance) Run

func (oi *OneInstance) Run(fn func()) bool

func (*OneInstance) RunAndLogIfNotRun

func (oi *OneInstance) RunAndLogIfNotRun(fn func())

type OneInstanceMap

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

func (*OneInstanceMap) IsRunning

func (m *OneInstanceMap) IsRunning(key string) bool

func (*OneInstanceMap) Run

func (m *OneInstanceMap) Run(key string, fn func()) bool

type Rc

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

func (*Rc) Add

func (rc *Rc) Add(i int)

func (*Rc) Dec

func (rc *Rc) Dec()

func (*Rc) Done

func (rc *Rc) Done()

func (*Rc) GetRc

func (rc *Rc) GetRc() int

func (*Rc) Inc

func (rc *Rc) Inc()

func (*Rc) Wait

func (rc *Rc) Wait()

type SetString

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

func (*SetString) Add

func (ss *SetString) Add(k string)

func (*SetString) Clear

func (ss *SetString) Clear()

func (*SetString) GetStringSliceAndClear

func (ss *SetString) GetStringSliceAndClear() (list []string)

func (*SetString) Has

func (ss *SetString) Has(k string) bool

func (*SetString) IsIn

func (ss *SetString) IsIn(k string) bool

func (*SetString) Len

func (ss *SetString) Len() int

func (*SetString) Set

func (ss *SetString) Set(k string)

type String

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

func NewString

func NewString(s string) *String

func (*String) Get

func (s *String) Get() string

func (*String) Set

func (s *String) Set(v string)

type StringMutexMap

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

func (*StringMutexMap) LockByString

func (m *StringMutexMap) LockByString(s string)

func (*StringMutexMap) UnlockByString

func (m *StringMutexMap) UnlockByString(s string)

type Time

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

func NewTime

func NewTime(s time.Time) *Time

func (*Time) Get

func (s *Time) Get() time.Time

func (*Time) Set

func (s *Time) Set(v time.Time)

Jump to

Keyboard shortcuts

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