// RemoveListener removes a listener with the given listenerID.
RemoveListener removes a listener with the given listenerID.
// RemoveListener removes a listener with the given listenerID .
func (dt *DTopic) RemoveListener(listenerID uint64) error {
	err := dt.removeStreamListener(listenerID)
	if err != nil {
		return err
	}
	dt.mu.Lock()
	delete(dt.listeners, listenerID)
	dt.mu.Unlock()
	req := protocol.NewDTopicMessage(protocol.OpDTopicRemoveListener)
	req.SetDTopic(dt.name)
	req.SetExtra(protocol.DTopicRemoveListenerExtra{
		ListenerID: listenerID,
	})
	resp, err := dt.request(req)
	if err != nil {
		return err
	}
	err = checkStatusCode(resp)
	if err != nil {
		return err
	}
	return nil
}
func ( dt * DTopic ) RemoveListener ( listenerID uint64 ) error { err := dt . removeStreamListener ( listenerID ) if err != nil { return err } dt . mu . Lock ( ) delete ( dt . listeners , listenerID ) dt . mu . Unlock ( ) req := protocol . NewDTopicMessage ( protocol . OpDTopicRemoveListener ) req . SetDTopic ( dt . name ) req . SetExtra ( protocol . DTopicRemoveListenerExtra { ListenerID : listenerID , } ) resp , err := dt . request ( req ) if err != nil { return err } err = checkStatusCode ( resp ) if err != nil { return err } return nil }
RemoveListener removes a listener with the given listenerID.
RemoveListener removes a listener with the given listenerID .
// Destroy locally. // Remove it from the server.