concurrent

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockingQueue

type BlockingQueue struct {
	Queue
	// contains filtered or unexported fields
}

func (*BlockingQueue) Pop

func (q *BlockingQueue) Pop() interface{}

func (*BlockingQueue) Push

func (q *BlockingQueue) Push(obj interface{})

func (*BlockingQueue) Reset

func (q *BlockingQueue) Reset() *BlockingQueue

type BurstWaitGroup

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

func (*BurstWaitGroup) Add

func (w *BurstWaitGroup) Add(delta int)

func (*BurstWaitGroup) Burst

func (w *BurstWaitGroup) Burst()

func (*BurstWaitGroup) Done

func (w *BurstWaitGroup) Done()

func (*BurstWaitGroup) Remain

func (w *BurstWaitGroup) Remain() int

func (*BurstWaitGroup) Wait

func (w *BurstWaitGroup) Wait()

type ChainFuture added in v1.1.0

type ChainFuture interface {
	Future
	Parent() ChainFuture
}

func NewChainFuture added in v1.1.0

func NewChainFuture(future ChainFuture) ChainFuture

type Completable added in v1.1.0

type Completable interface {
	Complete(obj interface{}) bool
	Cancel() bool
	Fail(err error) bool
}

type DefaultFuture

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

func (*DefaultFuture) AddListener

func (f *DefaultFuture) AddListener(listener FutureListener) Future

func (*DefaultFuture) Await

func (f *DefaultFuture) Await() Future

func (*DefaultFuture) AwaitTimeout added in v1.0.11

func (f *DefaultFuture) AwaitTimeout(timeout time.Duration) Future

func (*DefaultFuture) Cancel

func (f *DefaultFuture) Cancel() bool

func (*DefaultFuture) Chainable added in v1.1.0

func (f *DefaultFuture) Chainable() ChainFuture

func (*DefaultFuture) Completable added in v1.0.3

func (f *DefaultFuture) Completable() Completable

func (*DefaultFuture) Complete

func (f *DefaultFuture) Complete(obj interface{}) bool

func (*DefaultFuture) Done added in v1.0.4

func (f *DefaultFuture) Done() <-chan struct{}

func (*DefaultFuture) Error

func (f *DefaultFuture) Error() error

func (*DefaultFuture) Fail

func (f *DefaultFuture) Fail(err error) bool

func (*DefaultFuture) Get

func (f *DefaultFuture) Get() interface{}

func (*DefaultFuture) GetNow added in v1.1.0

func (f *DefaultFuture) GetNow() interface{}

func (*DefaultFuture) GetTimeout added in v1.0.11

func (f *DefaultFuture) GetTimeout(timeout time.Duration) interface{}

func (*DefaultFuture) Immutable added in v1.0.12

func (f *DefaultFuture) Immutable() Immutable

func (*DefaultFuture) IsCancelled

func (f *DefaultFuture) IsCancelled() bool

func (*DefaultFuture) IsDone

func (f *DefaultFuture) IsDone() bool

func (*DefaultFuture) IsFail added in v1.1.0

func (f *DefaultFuture) IsFail() bool

func (*DefaultFuture) IsSuccess

func (f *DefaultFuture) IsSuccess() bool

func (*DefaultFuture) Parent added in v1.1.0

func (f *DefaultFuture) Parent() ChainFuture

func (*DefaultFuture) Set added in v1.1.1

func (f *DefaultFuture) Set(obj interface{})

func (*DefaultFuture) Then added in v1.1.0

func (f *DefaultFuture) Then(fn func(parent Future) interface{}) (future Future)

func (*DefaultFuture) ThenAsync added in v1.1.0

func (f *DefaultFuture) ThenAsync(fn func(parent Future) interface{}) (future Future)

type Future

type Future interface {
	Immutable
	Completable() Completable
	Immutable() Immutable
	Chainable() ChainFuture
	Then(fn func(parent Future) interface{}) (future Future)
	ThenAsync(fn func(parent Future) interface{}) (future Future)
}

func Do added in v1.1.0

func Do(f func() interface{}) (future Future)

func DoAsync added in v1.1.0

func DoAsync(f func() interface{}) (future Future)

func NewCancelledFuture

func NewCancelledFuture() Future

func NewCompletedFuture added in v1.1.0

func NewCompletedFuture(obj interface{}) Future

func NewFailedFuture

func NewFailedFuture(err error) Future

func NewFuture

func NewFuture() Future

type FutureListener

type FutureListener interface {
	OperationCompleted(f Future)
}

func NewFutureListener

func NewFutureListener(f func(f Future)) FutureListener

type Immutable added in v1.1.0

type Immutable interface {
	Get() interface{}
	GetTimeout(timeout time.Duration) interface{}
	GetNow() interface{}
	Done() <-chan struct{}
	Await() Future
	AwaitTimeout(timeout time.Duration) Future
	IsDone() bool
	IsSuccess() bool
	IsCancelled() bool
	IsFail() bool
	Error() error
	AddListener(listener FutureListener) Future
}

type Mutex added in v1.0.13

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

func (*Mutex) IsLocked added in v1.1.0

func (m *Mutex) IsLocked() bool

IsLocked check locker status

func (*Mutex) Lock added in v1.0.13

func (m *Mutex) Lock()

Lock wait and get lock

func (*Mutex) TryLock added in v1.0.13

func (m *Mutex) TryLock() bool

TryLock try to lock Mutex if it is unlocked it will return `true` when get lock success or `false` on fail

func (*Mutex) TryLockTimeout added in v1.0.13

func (m *Mutex) TryLockTimeout(timeout time.Duration) bool

TryLockTimeout try to get lock with timeout, if it can't get lock until timeout, it will return `false` it will return `true` when get lock success or `false` on fail

func (*Mutex) Unlock added in v1.0.13

func (m *Mutex) Unlock()

Unlock unlock mutex

func (*Mutex) Unlocked added in v1.1.0

func (m *Mutex) Unlocked() chan struct{}

Unlocked wait until current lock release

type Queue

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

func (*Queue) Len

func (q *Queue) Len() int

func (*Queue) Pop

func (q *Queue) Pop() interface{}

func (*Queue) Push

func (q *Queue) Push(obj interface{})

func (*Queue) Reset

func (q *Queue) Reset() *Queue

type Settable added in v1.1.1

type Settable interface {
	Set(obj interface{})
}

type TryLocker added in v1.1.0

type TryLocker interface {
	TryLock() bool
	TryLockTimeout(timeout time.Duration) bool
}

Jump to

Keyboard shortcuts

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