code: func (ac *asyncCallbacksHandler) asyncCBDispatcher() {
  	for {
  		ac.mu.Lock()
  		// Protect for spurious wakeups. We should get out of the
  		// wait only if there is an element to pop from the list.
  		for ac.head == nil {
  			ac.cond.Wait()
  		}
  		cur := ac.head
  		ac.head = cur.next
  		if cur == ac.tail {
  			ac.tail = nil
  		}
  		ac.mu.Unlock()
  
  		// This signals that the dispatcher has been closed and all
  		// previous callbacks have been dispatched.
  		if cur.f == nil {
  			return
  		}
  		// Invoke callback outside of handler's lock
  		cur.f()
  	}
  }
docs: // dispatch is responsible for calling any async callbacks