// Removes a Channel from being tracked.
334221
func (st *stateTracker) DelChannel(c string) *Channel {
	st.mu.Lock()
	defer st.mu.Unlock()
	if ch, ok := st.chans[c]; ok {
		st.delChannel(ch)
		return ch.Channel()
	}
	logging.Warn("Tracker.DelChannel(): %s not tracked.", c)
	return nil
}
1229943
func (g Gauge) Remove() {
	gm.Lock()
	defer gm.Unlock()

	delete(gauges, string(g))
	delete(inits, string(g))
}
464921
func (ns *nurseryStore) RemoveChannel(chanPoint *wire.OutPoint) error {
	return ns.db.Update(func(tx *bbolt.Tx) error {
		// Retrieve the existing chain bucket for this nursery store.
		chainBucket := tx.Bucket(ns.pfxChainKey)
		if chainBucket == nil {
			return nil
		}

		// Retrieve the channel index stored in the chain bucket.
		chanIndex := chainBucket.Bucket(channelIndexKey)
		if chanIndex == nil {
			return nil
		}

		// Serialize the provided channel point, such that we can delete
		// the mature channel bucket.
		var chanBuffer bytes.Buffer
		if err := writeOutpoint(&chanBuffer, chanPoint); err != nil {
			return err
		}
		chanBytes := chanBuffer.Bytes()

		err := ns.forChanOutputs(tx, chanPoint, func(k, v []byte) error {
			if !bytes.HasPrefix(k, gradPrefix) {
				return ErrImmatureChannel
			}

			// Construct a kindergarten prefixed key, since this
			// would have been the preceding state for a grad
			// output.
			kndrKey := make([]byte, len(k))
			copy(kndrKey, k)
			copy(kndrKey[:4], kndrPrefix)

			// Decode each to retrieve the output's maturity height.
			var kid kidOutput
			if err := kid.Decode(bytes.NewReader(v)); err != nil {
				return err
			}

			maturityHeight := kid.ConfHeight() + kid.BlocksToMaturity()

			hghtBucket := ns.getHeightBucket(tx, maturityHeight)
			if hghtBucket == nil {
				return nil
			}

			return removeBucketIfExists(hghtBucket, chanBytes)
		})
		if err != nil {
			return err
		}

		return removeBucketIfExists(chanIndex, chanBytes)
	})
}
755623
func (c *Closer) Close() {
	// Lock the mutex
	c.mutex.Lock()
	defer c.mutex.Unlock()

	// Just return if already closed.
	if c.IsClosed() {
		return
	}

	// Close the channel.
	close(c.IsClosedChan)

	// Emit the function.
	c.f()
}
147985
func (c *Conn) Unlisten(channel string) error {
	_, err := c.Exec("unlisten " + quoteIdentifier(channel))
	if err != nil {
		return err
	}

	delete(c.channels, channel)
	return nil
}
1054532
func (st *stateTracker) Dissociate(c, n string) {
	st.mu.Lock()
	defer st.mu.Unlock()
	nk, nok := st.nicks[n]
	ch, cok := st.chans[c]

	if !cok {
		// As we can implicitly delete both nicks and channels from being
		// tracked by dissociating one from the other, we should verify that
		// we're not being passed an old Nick or Channel.
		logging.Error("Tracker.Dissociate(): channel %s not found in "+
			"internal state.", c)
	} else if !nok {
		logging.Error("Tracker.Dissociate(): nick %s not found in "+
			"internal state.", n)
	} else if _, ok := nk.isOn(ch); !ok {
		logging.Warn("Tracker.Dissociate(): %s not on %s.",
			nk.nick, ch.name)
	} else if nk == st.me {
		// I'm leaving the channel for some reason, so it won't be tracked.
		st.delChannel(ch)
	} else {
		// Remove the nick from the channel and the channel from the nick.
		ch.delNick(nk)
		nk.delChannel(ch)
		if len(nk.chans) == 0 {
			// We're no longer in any channels with this nick.
			st.delNick(nk)
		}
	}
}
840058
func (s *Session) ChannelMessageDelete(channelID, messageID string) (err error) {

	_, err = s.RequestWithBucketID("DELETE", EndpointChannelMessage(channelID, messageID), nil, EndpointChannelMessage(channelID, ""))
	return
}
291451
func (self *watcher) isRemove(event *fsnotify.Event) bool {
	return event.Op&fsnotify.Remove == fsnotify.Remove
}
486937
func RemoveChannel(ident, channelName, user, organization string) error {
	query := utils.M{
		"org":           organization,
		"user":          user,
		"ident":         ident,
		"channels.name": channelName,
	}

	found := new(db.Topic)

	err := db.Conn.GetOne(
		db.TopicCollection,
		query,
		found,
	)

	err = db.Conn.Update(
		db.TopicCollection,
		query,
		utils.M{
			"$set": utils.M{
				"channels.$.enabled": false,
			},
		},
	)

	return err
}
296268
func (c *Client) Unsubscribe(channel ...string) error {
	args := make([][]byte, len(channel)+1)
	args[0] = []byte("UNSUBSCRIBE")

	for i := range channel {
		args[1+i] = to.Bytes(channel[i])
	}

	err := c.bcommand(nil, args...)

	return err
}
149344
func RemoveIPMemberFromChannel(client *TwilioIPMessagingClient, serviceSid, channelSid, sid string) error {
	return client.delete("/Services/" + serviceSid + "/Channels/" + channelSid + "/Members/" + sid)
}
648359
func (s *Switch) RemoveLink(chanID lnwire.ChannelID) {
	s.indexMtx.Lock()
	link := s.removeLink(chanID)
	s.indexMtx.Unlock()

	if link != nil {
		link.Stop()
	}
}
1105875
func (s *server) RemoveRebroadcastInventory(iv *wire.InvVect) {
	// Ignore if shutting down.
	if atomic.LoadInt32(&s.shutdown) != 0 {
		return
	}

	s.modifyRebroadcastInv <- broadcastInventoryDel(iv)
}
1311681
func (sc *conn) removeAck(guid string) *ack {
	var t *time.Timer
	sc.Lock()
	a := sc.pubAckMap[guid]
	if a != nil {
		t = a.t
		delete(sc.pubAckMap, guid)
	}
	pac := sc.pubAckChan
	sc.Unlock()

	// Cancel timer if needed.
	if t != nil {
		t.Stop()
	}

	// Remove from channel to unblock PublishAsync
	if a != nil && len(pac) > 0 {
		<-pac
	}
	return a
}
261126
func (c *Channel) Unlink(channel ...*Channel) {
	packet := MumbleProto.ChannelState{
		ChannelId: &c.ID,
	}
	if len(channel) == 0 {
		packet.LinksRemove = make([]uint32, len(c.Links))
		i := 0
		for channelID := range c.Links {
			packet.LinksRemove[i] = channelID
			i++
		}
	} else {
		packet.LinksRemove = make([]uint32, len(channel))
		for i, ch := range channel {
			packet.LinksRemove[i] = ch.ID
		}
	}
	c.client.Conn.WriteProto(&packet)
}
152207
func (*wsNotificationManager) removeAddrRequest(addrs map[string]map[chan struct{}]*wsClient,
	wsc *wsClient, addr string) {

	// Remove the request tracking from the client.
	delete(wsc.addrRequests, addr)

	// Remove the client from the list to notify.
	cmap, ok := addrs[addr]
	if !ok {
		rpcsLog.Warnf("Attempt to remove nonexistent addr request "+
			"<%s> for websocket client %s", addr, wsc.addr)
		return
	}
	delete(cmap, wsc.quit)

	// Remove the map entry altogether if there are no more clients
	// interested in it.
	if len(cmap) == 0 {
		delete(addrs, addr)
	}
}
296536
func (m *Manager) removeProxyServiceLocked(proxyID string) {
	state, ok := m.proxies[proxyID]
	if !ok {
		return
	}

	// Closing state will let the goroutine we started in Ensure finish since
	// watch chan is closed.
	state.Close()
	delete(m.proxies, proxyID)

	// We intentionally leave potential watchers hanging here - there is no new
	// config for them and closing their channels might be indistinguishable from
	// an error that they should retry. We rely for them to eventually give up
	// (because they are in fact not running any more) and so the watches be
	// cleaned up naturally.
}