func (w *watcher) queueRequest(handle *protocol.RequestHandle) bool { w.mutex.Lock() defer w.mutex.Unlock() if w.isClosed { handle.Err = errors.New("Connection is shutting down. Cannot process incoming request") return false } w.incomingReqs <- handle return true }
func (w *watcher) signalError(request *protocol.RequestHandle, errStr string) { request.Err = errors.New(errStr) request.CondVar.L.Lock() defer request.CondVar.L.Unlock() request.CondVar.Signal() }