func (c *channelPriorityQueue) Close() {
	close(c.shutdownCh)
}
Destroy - destroys the channel priority queue
package collection
import "fmt"
const numPriorities = 2
type channelPriorityQueue struct {
	channels   []chan interface{}
	shutdownCh chan struct{}
}
type ChannelPriorityQueue interface {
	Add(priority int, item interface{}) bool
	Remove() (interface{}, bool)
	Close()
}
func NewChannelPriorityQueue(queueSize int) ChannelPriorityQueue {
	channels := make([]chan interface{}, numPriorities)
	for i := range channels {
		channels[i] = make(chan interface{}, queueSize)
	}
	return &channelPriorityQueue{
		channels:   channels,
		shutdownCh: make(chan struct{}),
	}
}
func (c *channelPriorityQueue) Add(priority int, item interface{}) bool {
	if priority >= numPriorities {
		panic(fmt.Sprintf("trying to add item with invalid priority %v, queue only supports %v priorities", priority, numPriorities))
	}
	select {
	case c.channels[priority] <- item:
	case <-c.shutdownCh:
		return false
	}
	return true
}
func (c *channelPriorityQueue) Remove() (interface{}, bool) {
	select {
	case item, ok := <-c.channels[0]:
		return item, ok
	case <-c.shutdownCh:
		return nil, false
	default:
	}
	var item interface{}
	var ok bool
	select {
	case item, ok = <-c.channels[0]:
	case item, ok = <-c.channels[1]:
	case <-c.shutdownCh:
	}
	return item, ok
}