oleiade / lane

Generic PriorityQueues, Queues, Stacks, and Deque data structures for Go
https://pkg.go.dev/github.com/oleiade/lane#pkg-types
MIT License
874 stars 76 forks source link

Queue work failed #17

Open anbaoyong opened 7 years ago

anbaoyong commented 7 years ago

@oleiade when i use Queue's example ,the result is endless loop . the @code: var queue *Queue = NewQueue()

// Let's add the incoming clients to the queue queue.Enqueue("grumpyClient") queue.Enqueue("happyClient") queue.Enqueue("ecstaticClient")

fmt.Println(queue.Head) // grumpyClient

// Let's handle the clients asynchronously for client := queue.Dequeue(); client != nil; { go fmt.Println(client) }

anbaoyong commented 7 years ago

it seems that 'queue.Dequeue()' cann't remove the item.