package main
import "fmt"
import "github.com/oleiade/lane"
import "runtime"
func main() {
// runtime.GOMAXPROCS(3)
queue := lane.NewQueue()
queue.Enqueue("grumpyClient")
queue.Enqueue("happyClient")
queue.Enqueue("ecstaticClient")
// Let's handle the clients asynchronously
for client := queue.Dequeue(); client != nil; {
go fmt.Println(client)
}
}
What I expected from it: should print 3 strings from queue and exit.
What actually happens: prints "grumpyClient" lots of times. Removing "go" in loop does not change anything.
Tested on go1.4.1 darwin/amd64(os x 10.9.5) and go1.2.1 linux/amd64(ubuntu precise). Same thing
Uncommenting line with runtime.GOMAXPROCS(3) causes lots of tracebacks on OS X(not on linux).
I tried this code sample based on README:
What I expected from it: should print 3 strings from queue and exit. What actually happens: prints "grumpyClient" lots of times. Removing "go" in loop does not change anything.
Tested on go1.4.1 darwin/amd64(os x 10.9.5) and go1.2.1 linux/amd64(ubuntu precise). Same thing
Uncommenting line with
runtime.GOMAXPROCS(3)
causes lots of tracebacks on OS X(not on linux).