// NewTimeoutQueue returns an idle TimeoutQueue
NewTimeoutQueue returns an idle TimeoutQueue
// NewTimeoutQueue returns an idle TimeoutQueue
func NewTimeoutQueue() *TimeoutQueue {
	t := time.NewTimer(0)
	if !t.Stop() {
		<-t.C
	}
	return &TimeoutQueue{
		stop:    nil,
		running: 0,
		mu:             new(sync.RWMutex),
		hasExpiredData: make(chan struct{}),
		blackList: make(map[interface{}]struct{}),
		index:     make(map[interface{}]int),
		data:      make([]*TimeoutData, 0, 16),
		timer:   t,
		resetCh: make(chan int64, 1),
		timeGot: 1,
		timeoutCh: make(chan *TimeoutData, 1),
	}
}
func NewTimeoutQueue ( ) * TimeoutQueue { t := time . NewTimer ( 0 ) if ! t . Stop ( ) { <- t . C } return & TimeoutQueue { stop : nil , running : 0 , mu : new ( sync . RWMutex ) , hasExpiredData : make ( chan struct { } ) , blackList : make ( map [ interface { } ] struct { } ) , index : make ( map [ interface { } ] int ) , data : make ( [ ] * TimeoutData , 0 , 16 ) , timer : t , resetCh : make ( chan int64 , 1 ) , timeGot : 1 , timeoutCh : make ( chan * TimeoutData , 1 ) , } }
NewTimeoutQueue returns an idle TimeoutQueue
NewTimeoutQueue returns an idle TimeoutQueue