Skip to content

Commit

Permalink
update README after handling next internally
Browse files Browse the repository at this point in the history
  • Loading branch information
kavehmz committed Dec 29, 2015
1 parent e2ba949 commit fc78ae2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions README.md
Expand Up @@ -36,19 +36,17 @@ func main() {
q.AddTask(2, "start")
q.AddTask(1, "stop")
q.AddTask(2, "stop")
analyzer := func(id int, task chan string, success chan bool, next chan bool) {
analyzer := func(id int, task chan string, success chan bool) {
for {
select {
case msg := <-task:
fmt.Println(id, msg)
if msg == "stop" {
<-next
success <- true
return
}
case <-time.After(2 * time.Second):
fmt.Println("no new events for 2 seconds for ID", id)
<-next
success <- false
return
}
Expand Down

0 comments on commit fc78ae2

Please sign in to comment.