// insert an entry into the time out queue
insert an entry into the time out queue
// insert an entry into the time out queue
func (twoway *Bilateral) insertEvent(id uint32, delay time.Duration) {
	if 0 == delay {
		return
	}
	t := time.Now().Add(delay)
	v := queueItem{
		timestamp: t,
		id:        id,
	}
	for e := twoway.timeoutQueue.Front(); nil != e; e = e.Prev() {
		if t.After(e.Value.(queueItem).timestamp) {
			twoway.timeoutQueue.InsertAfter(v, e)
			return
		}
	}
	twoway.timeoutQueue.PushFront(v)
}
func ( twoway * Bilateral ) insertEvent ( id uint32 , delay time . Duration ) { if 0 == delay { return } t := time . Now ( ) . Add ( delay ) v := queueItem { timestamp : t , id : id , } for e := twoway . timeoutQueue . Front ( ) ; nil != e ; e = e . Prev ( ) { if t . After ( e . Value . ( queueItem ) . timestamp ) { twoway . timeoutQueue . InsertAfter ( v , e ) return } } twoway . timeoutQueue . PushFront ( v ) }
insert an entry into the time out queue
insert an entry into the time out queue
// if no timeout required