Documentation
¶
Index ¶
- type Synchain
- func (sg *Synchain) Cancel(err error)
- func (sg *Synchain) Done()
- func (sg *Synchain) Err() error
- func (sg *Synchain) Go(fn func(t Ticket) error)
- func (sg *Synchain) Init()
- func (sg *Synchain) Lock(t Ticket) bool
- func (sg *Synchain) NewTicket() (ret Ticket)
- func (sg *Synchain) Unlock(t Ticket)
- func (sg *Synchain) Wait()
- type Ticket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Synchain ¶
type Synchain struct {
// contains filtered or unexported fields
}
Synchain is a helper to implement internal sequential execution of parallel jobs
NOTE: Init MUST be called before calling other methods
func (*Synchain) Go ¶
Go spawns a new goroutine in the sync group, user func MUST call Lock with the ticket passed
on error return of user func, it calls Cancel and Done, otherwise, calls Unlock and Done
Click to show internal directories.
Click to hide internal directories.