Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrSlaveOpened occurs whem the same // slave is open twice ErrSlaveOpened = errors.New("slave is already opened") )
Functions ¶
This section is empty.
Types ¶
type Slave ¶
type Slave struct { // Name of slave Name string // Work of slave Work func(interface{}) interface{} // Function that will be execute when // Work finishes. The return value of // Work() will be parse to After() After func(interface{}) // contains filtered or unexported fields }
Slave object that will do the works
func NewSlave ¶
NewSlave Create a slave easily parsing the name of slave, work to do when SendWork it's called (cannot be nil) and work to do after Work() it's called
func (*Slave) Close ¶
func (s *Slave) Close()
Close waits all jobs to finish and close buffered channel of jobs
func (*Slave) Open ¶
Open Creates job buffered channel and starts a goroutine which will receive all works asynchronously
Click to show internal directories.
Click to hide internal directories.