Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AbortGroup ¶
type AbortGroup struct {
// contains filtered or unexported fields
}
Alternative to sync/errgrp.ErrorGroup that cancels a context on the first error, rather than waiting for all goroutines to finish before failing.
NOTE: This is not even necessary as there is errgroup.WithContext, though this may be slightly more ergonomic. Probably not worth it.
func NewAbortGroup ¶
func NewAbortGroup(ctx context.Context) *AbortGroup
func (*AbortGroup) Wait ¶
func (grp *AbortGroup) Wait() (rerr error)
type AllErrGroup ¶
type AllErrGroup struct {
// contains filtered or unexported fields
}
func WithContext ¶
func WithContext(ctx context.Context) (*AllErrGroup, context.Context)
func (*AllErrGroup) Errors ¶
func (g *AllErrGroup) Errors() []error
func (*AllErrGroup) Go ¶
func (g *AllErrGroup) Go(f func() error)
func (*AllErrGroup) SetLimit ¶
func (g *AllErrGroup) SetLimit(n int)
func (*AllErrGroup) TryGo ¶
func (g *AllErrGroup) TryGo(f func() error) bool
func (*AllErrGroup) Wait ¶
func (g *AllErrGroup) Wait() error
type ChanGroup ¶
type ChanGroup struct {
// contains filtered or unexported fields
}
func NewChanGroup ¶
func NewChanGroup() *ChanGroup
type CondGroup ¶
type CondGroup struct {
// contains filtered or unexported fields
}
CondGroup implements a less volatile, more general-purpose waitgroup than sync.WaitGroup.
Unlike sync.WaitGroup, new Add calls can occur before all previous waits have returned.
func NewCondGroup ¶
func NewCondGroup() *CondGroup
type LoggingMutex ¶
func (*LoggingMutex) Lock ¶
func (l *LoggingMutex) Lock()
func (*LoggingMutex) Unlock ¶
func (l *LoggingMutex) Unlock()
type LoggingRWMutex ¶
func (*LoggingRWMutex) Lock ¶
func (l *LoggingRWMutex) Lock()
func (*LoggingRWMutex) RLock ¶
func (l *LoggingRWMutex) RLock()
func (*LoggingRWMutex) RUnlock ¶
func (l *LoggingRWMutex) RUnlock()
func (*LoggingRWMutex) Unlock ¶
func (l *LoggingRWMutex) Unlock()
type TaskSlot ¶
type TaskSlot struct {
// contains filtered or unexported fields
}
This is a bit of boilerplate for a very specific type of task running scenario.
- Only one task can run at a time.
- It may be cancelled and replaced with a task at any time.
- If you need to wait for the task, you need to implement that yourself. This does not handle serialisation, only mutual exclusion.
--
func NewTaskSlot ¶
func NewTaskSlot() *TaskSlot
Click to show internal directories.
Click to hide internal directories.