Skip to content
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Example usage:
package main

import (
"github.com/jrallison/go-workers"
"github.com/jrallison/go-workers"
)

func myJob(message *workers.Msg) {
Expand Down
3 changes: 2 additions & 1 deletion manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@ func (m *manager) manage() {

go m.fetch.Fetch()

Lmanage:
for {
select {
case message := <-m.confirm:
m.fetch.Acknowledge(message)
case <-m.stop:
m.exit <- true
break
break Lmanage
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func (w *worker) quit() {
}

func (w *worker) work(messages chan *Msg) {
Lwork:
for {
select {
case message := <-messages:
Expand All @@ -40,9 +41,10 @@ func (w *worker) work(messages chan *Msg) {
// ready to accept a message
case <-w.stop:
w.exit <- true
return
break Lwork
}
}

}

func (w *worker) process(message *Msg) (acknowledge bool) {
Expand Down