func (e *eventChannel) send(ctx context.Context, ev *QueryEvent) {
	e.mu.Lock()
	// Closed.
	if e.ch == nil {
		e.mu.Unlock()
		return
	}
	// in case the passed context is unrelated, wait on both.
	select {
	case e.ch <- ev:
	case <-e.ctx.Done():
	case <-ctx.Done():
	}
	e.mu.Unlock()
}
func (e *eventChannel) send(ctx context.Context, ev *QueryEvent) {
	e.mu.Lock()
	
	if e.ch == nil {
		e.mu.Unlock()
		return
	}
	
	select {
	case e.ch <- ev:
	case <-e.ctx.Done():
	case <-ctx.Done():
	}
	e.mu.Unlock()
}
func ( e * eventChannel ) send ( ctx context . Context , ev * QueryEvent ) { e . mu . Lock ( ) // Closed. if e . ch == nil { e . mu . Unlock ( ) return } // in case the passed context is unrelated, wait on both. select { case e . ch <- ev : case <- e . ctx . Done ( ) : case <- ctx . Done ( ) : } e . mu . Unlock ( ) }
// send sends an event on the event channel, aborting if either the passed or
// the internal context expire.
send sends an event on the event channel aborting if either the passed or the internal context expire .