Disconnect a callback from this emitter.

        If no callback is specified, then *all* callbacks are removed.
        If the callback was not already connected, then the call does nothing.
322334
def disconnect(self, callback=None):
        
        if callback is None:
            self._callbacks = []
            self._callback_refs = []
        else:
            callback = self._normalize_cb(callback)
            if callback in self._callbacks:
                idx = self._callbacks.index(callback)
                self._callbacks.pop(idx)
                self._callback_refs.pop(idx)
655357
def disconnect(self, event, cb):
        
        try:
            self._callbacks[event].remove(cb)
        except KeyError:
            raise ValueError("{!r} is not a valid cursor event".format(event))
        except ValueError:
            raise ValueError("Callback {} is not registered".format(event))
1159611
def unlisten(self, event, callback):
        
        try:
            self.listeners[event].remove(callback)
        except ValueError:
            return False
        else:
            return True
467621
def unbind (self, event, callback):
        
        if self._events.has_key(event) and len(self._events[event]) > 0:
            for _callback in self._events[event]:
                if _callback == callback:
                    self._events[event].remove(callback)
                if len(self._events[event]) == 0:
                    del self._events[event]
620122
def disconnect(self, receiver):
        """"""
        try:
            self.receivers.remove(receiver)
        except ValueError:
            raise ValueError('Unknown receiver: %s' % receiver)
448519
def disconnect_async(self, conn_id, callback):
        """"""

        future = self._loop.launch_coroutine(self._adapter.disconnect(conn_id))
        future.add_done_callback(lambda x: self._callback_future(conn_id, x, callback))
912445
function() {
        if (!this._callbacks) return;
        this.__callbacksFrozen = false;
        for (var event in this._callbacks) {
            if (this._callbacks[event]) {
                // Remove the normal way, in case we've got a nested loop
                this._unbindCallbacks(event);
                // Also completely delete the registered callback from handlers
                delete handlers[event][this[0]];
            }
        }
    }
632888
def remove_socket(self, socket):
        
        if socket in self._sockets:
            socket.on_closed.disconnect(self.remove_socket)
            self._sockets.remove(socket)
4222
def remove_listener(self, event, callback, single=None, priority=None):
        
        event_stack = self._events[event]
        for x in event_stack:
            if x['callback'] == callback and \
               (single is None or x['single'] == single) and \
               (priority is None or x['priority'] == priority):
                event_stack.remove(x)
                break
        else:
            raise KeyError('Listener not found for "%s": %s' % (event,
                           callback))
180531
public void disconnect(){
        if(timer != null){
            timer.cancel();
        }
        if (ws != null && ws.isOpen()) {
            ws.disconnect();
            subscribedTokens = new HashSet<>();
            modeMap.clear();
        }
    }
1358277
function (callback) {
            debug('');

            self.eventStore.on('connect', function () {
              self.emit('connect');
            });

            self.eventStore.on('disconnect', function () {
              self.emit('disconnect');
            });

            self.eventStore.init(callback);
          }
839810
function(callbacks, context){
      // avoid warnings on trying to remove handler for destroyed instance
      // since it droped all handlers
      if (this.destroy === warnOnDestroy)
        return;

      var cursor = this;
      var prev;

      context = context || this;

      // search for handler and remove it
      while (prev = cursor, cursor = cursor.handler)
        if (cursor.callbacks === callbacks && cursor.context === context)
        {
          // make it non-callable
          cursor.callbacks = NULL_HANDLER;

          // remove from list
          prev.handler = cursor.handler;

          return;
        }

      // handler not found
      /** @cut */ basis.dev.warn(namespace + '.Emitter#removeHandler: no handler removed');
    }
999984
public int removeCallback(IConnectionStateCallback criteria) {
		  
		  List<IConnectionStateCallback> listCallbacks = getConnectionDetail().getConnCallbacks();
		  /**
		   * If this method is about to delete the last callback, then
		   * there are no windows left listening, so it is safe to
		   * do a hard disconnect.
		   */
		  if (listCallbacks.size() <= 1) {
			  getConnectionDetail().unHappyDisconnect();
			  listCallbacks.remove(criteria);
			  
			  DefaultConnectionList connList = (DefaultConnectionList) DefaultConnectionList.getSingleton();
			  connList.remove(this);
			  
		  } else {
			//utter a last dying gasp (DISCONNECTED status) before removing the callback.
			  //criteria.setConnectionState(ConnectState.DISCONNECTED);
			  //broadcastConnectionState(criteria);
			  listCallbacks.remove(criteria);
		  }
		  return listCallbacks.size();
	  }
146510
function disconnect(conn, socket, err) {
  //console.dir('disconnect');

  // clean monitor listeners
  if(this._monitor[conn.id]) {
    this.removeListener('monitor', this._monitor[conn.id]);
    delete this._monitor[conn.id];
  }

  this._state.removeConnection(conn);
}
782675
def remove_callback(self, callback) -> None:
        """"""
        if callback in self._callbacks:
            self._callbacks.remove(callback)
1321275
def set_close_callback(self, cb):
        
        assert self._close_cb is None, (
            'A close_callback has already been set for this connection.'
        )
        self._close_cb = stack_context.wrap(cb)
        if self.closed:
            self._close_cb()
358334
def remove_callback(self, instance, func):
        
        for cb in [self._callbacks, self._2arg_callbacks]:
            if instance not in cb:
                continue
            if func in cb[instance]:
                cb[instance].remove(func)
                return
        else:
            raise ValueError("Callback function not found: %s" % func)