func (pq *priorityQueue) updatePriority(item *expiringBuffer, priority int64) {
	item.priority = priority
	heap.Fix(pq, item.index)
}
update modifies the priority of an item and updates the heap accordingly
package golongpoll
import (
	"container/heap"
	"fmt"
)
type expiringBuffer struct {
	eventBufferPtr *eventBuffer
	category string
	priority int64
	index int
}
type priorityQueue []*expiringBuffer
func (pq priorityQueue) Len() int { return len(pq) }
func (pq priorityQueue) Less(i, j int) bool {
	return pq[i].priority < pq[j].priority
}
func (pq priorityQueue) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
	pq[i].index = i
	pq[j].index = j
}
func (pq *priorityQueue) Push(x interface{}) {
	n := len(*pq)
	item := x.(*expiringBuffer)
	item.index = n
	*pq = append(*pq, item)
}
func (pq *priorityQueue) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	item.index = -1  
	*pq = old[0 : n-1]
	return item
}