Documentation
¶
Index ¶
- type Action
- type Bird
- type ErrorFunc
- type Flock
- func (f *Flock) Dissolve(land bool)
- func (f *Flock) Exclude(landBird bool, birdNames ...string) []*SmartBird
- func (f *Flock) Include(smartBird *SmartBird)
- func (f *Flock) Journal() Journal
- func (f *Flock) Land(names ...string)
- func (f *Flock) Raise(names ...string)
- func (f *Flock) Select(names ...string) []*SmartBird
- func (f *Flock) Take(birdToExclude *SmartBird, landBird bool) *SmartBird
- type Gun
- type Journal
- type Operation
- type SmartBird
- type StopFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bird ¶
Bird is an interface of object which must run forver untill stop signal occrued. If bird stops whenever with or without error it will be restarted after specified timeout. External systems may request force stop by sending any value to stop channel
type ErrorFunc ¶
type ErrorFunc func(err error)
The ErrorFunc function hould process error produced by Bird function
type Flock ¶
type Flock struct {
// contains filtered or unexported fields
}
Flock is a collection of smart birds
func (*Flock) Exclude ¶
Exclude some smart birds from a flock by their names and then returns them as list
func (*Flock) Journal ¶
Journal of all manipulations with birds in the flock. If journal was invoked, reader must read it all otherwise all block
func (*Flock) Land ¶
Land some smart birds in a flock by their names. If names not specified - all birds are used
type Gun ¶
type Gun <-chan int
Gun is a channel with stop signal. Any value from this channel indicates that bird must die
type SmartBird ¶
type SmartBird struct {
// contains filtered or unexported fields
}
A SmartBird is smarter bird then usual: it can starts and stops many times
func NewSmartBird ¶
NewSmartBird constructs new Smart Bird based on usuall bird, but without auto start