Removes the passed command from the queue.
@param {String} aggId The passed aggregate id.
@param {Object} cmd   The command to be queued.
357732
function (aggId, cmd) {
    if (!aggId || !_.isString(aggId)) {
      var err = new Error('Please pass a valid aggregate id!');
      debug(err);
      throw err;
    }

    _.remove(this.queue[aggId], function (c) {
      return c.command === cmd;
    });
  }
306600
function bridgeCommand(command,cb){
    if(!connected) return setImmediate(function(){
      cb('killed');
    });

    if(!connected.pings) connected.pings = {};
    var id = ++pingid;
    var timer;
    connected.pings[id] = function(err,data){
      clearTimeout(timer);
      delete connected.pings[id]
      cb(err,data);
    };
    connected.send({command:command,cb:id});
    // set 5 second time limit for callback.
    timer = setTimeout(function(){
      cb("timeout");
    },5000);
  }
783133
def delete(queue_id):
    '''
    

    '''

    ret = {'message': '',
           'result': True
           }

    if not queue_id:
        log.error('Require argument queue_id')

    if not queue_id == 'ALL':
        queue = show_queue()
        _message = None
        for item in queue:
            if item['queue_id'] == queue_id:
                _message = item

        if not _message:
            ret['message'] = 'No message in queue with ID {0}'.format(queue_id)
            ret['result'] = False
            return ret

    cmd = 'postsuper -d {0}'.format(queue_id)
    result = __salt__['cmd.run_all'](cmd)

    if result['retcode'] == 0:
        if queue_id == 'ALL':
            ret['message'] = 'Successfully removed all messages'
        else:
            ret['message'] = 'Successfully removed message with queue id {0}'.format(queue_id)
    else:
        if queue_id == 'ALL':
            ret['message'] = 'Unable to removed all messages'
        else:
            ret['message'] = 'Unable to remove message with queue id {0}: {1}'.format(queue_id, result['stderr'])
    return ret
1194405
function (cmd, callback) {
    if (!cmd || !_.isObject(cmd)) {
      var err = new Error('Please pass a valid command!');
      debug(err);
      throw err;
    }
    if (!callback || !_.isFunction(callback)) {
      var err = new Error('Please pass a valid callback!');
      debug(err);
      throw err;
    }

    var self = this;

    function _handle (aggId) {
      var concatenatedId = self.getConcatenatedId(aggId, cmd);

      var isFirst = !self.getNextCommandInQueue(concatenatedId);

      self.queueCommand(concatenatedId, cmd, callback);

      if (!isFirst) {
        return;
      }

      (function handleNext (aggregateId, c) {
        var concId = self.getConcatenatedId(aggregateId, c);
        var cmdEntry = self.getNextCommandInQueue(concId);
        if (cmdEntry) {
          if (cmdEntry.callback.length > 2) {
            self.workflow(aggregateId, cmdEntry.command, function (err, evts, aggData, meta) {
              self.removeCommandFromQueue(concId, cmdEntry.command);
              handleNext(aggregateId, cmdEntry.command);
              cmdEntry.callback(err, evts, aggData, meta);
            });
            return;
          }
          self.workflow(aggregateId, cmdEntry.command, function (err, evts) {
            self.removeCommandFromQueue(concId, cmdEntry.command);
            handleNext(aggregateId, cmdEntry.command);
            cmdEntry.callback(err, evts);
          });
        }
      })(aggId, cmd);
    }

    if (dotty.exists(cmd, this.definitions.command.aggregateId)) {
      return _handle(dotty.get(cmd, this.definitions.command.aggregateId));
    }

    debug('no aggregateId in command, so generate a new one');

    this.getNewAggregateId(cmd, function (err, id) {
      if (err) {
        debug(err);
        return callback(err);
      }

      return _handle(id);
    });
  }
1134981
async def remove(gc: GroupControl, slaves):
    """"""
    click.echo("Removing from existing group: %s" % slaves)
    click.echo(await gc.remove(slaves))
1147749
function (cmd, callback) {
    debug('called a custom command handler');
    console.log('Is your use case not solvable without a custom command handling? Sagas? Micro-Services?');

    var self = this;

    function _handle (aggId) {
      var concatenatedId = self.getConcatenatedId(aggId, cmd);

      var isFirst = !self.getNextCommandInQueue(concatenatedId);

      self.queueCommand(concatenatedId, cmd, callback);

      if (!isFirst) {
        return;
      }

      (function handleNext (aggregateId, c) {
        var concId = self.getConcatenatedId(aggregateId, c);
        var cmdEntry = self.getNextCommandInQueue(concId);
        if (cmdEntry) {
          if (cmdEntry.callback.length > 2) {
            self.cmdHndlFn(aggregateId, cmdEntry.command, self, function (err, evts, aggData, meta) {
              self.removeCommandFromQueue(concId, cmdEntry.command);
              handleNext(aggregateId, cmdEntry.command);
              cmdEntry.callback(err, evts, aggData, meta);
            });
            return;
          }
          self.cmdHndlFn(aggregateId, cmdEntry.command, self, function (err, evts) {
            self.removeCommandFromQueue(concId, cmdEntry.command);
            handleNext(aggregateId, cmdEntry.command);
            cmdEntry.callback(err, evts);
          });
        }
      })(aggId, cmd);
    }

    if (dotty.exists(cmd, this.definitions.command.aggregateId)) {
      return _handle(dotty.get(cmd, this.definitions.command.aggregateId));
    }

    debug('no aggregateId in command, so generate a new one');

    this.getNewAggregateId(cmd, function (err, id) {
      if (err) {
        debug(err);
        return callback(err);
      }

      return _handle(id);
    });
  }
1178838
def cmd(send, msg, args):
    
    parser = arguments.ArgParser(args['config'])
    group = parser.add_mutually_exclusive_group()
    group.add_argument('--clear', action='store_true')
    group.add_argument('--show', action='store_true')
    try:
        cmdargs = parser.parse_args(msg)
    except arguments.ArgumentException as e:
        send(str(e))
        return
    if cmdargs.clear:
        args['handler'].abuselist.clear()
        send("Abuse list cleared.")
    elif cmdargs.show:
        abusers = []
        for x in args['handler'].abuselist.keys():
            if args['db'].query(Ignore).filter(Ignore.nick == x).count():
                abusers.append(x)
        if abusers:
            send(", ".join(abusers))
        else:
            send("No abusers.")
    else:
        send("Please specify an option.")
1259719
public function removeCommandCallback($command, $method)
    {
        $command = strtolower($command);

        if (isset($this->__command_callbacks[$command]) )
        {
            if($method instanceof \Closure) {
                $index = spl_object_hash($method);
            } else {
                $index = $method;
            }

            unset($this->__command_callbacks[$command][$index]);
        }

        return $this;
    }
935728
public function delWait($message_type, $msgid)
    {
        if (isset($this->command_awaits[$message_type][$msgid])) {
            Debug::Log(Debug::DEBUG, "Forget " . Message::$name[$message_type] . " msgid={$msgid}");

            unset($this->command_awaits[$message_type][$msgid]);
            -- $this->command_awaits_counter;
        }
    }
188024
function (aggregate, streams, clb) {
        debug('handle command');
        self.letHandleCommandByAggregate(aggregate, cmd, function (err) { // err is a business rule error
          if (err) {
            return clb(err);
          }
          clb(null, aggregate, streams);
        });
      }
888686
def unregister(self, command):
        
        if command not in self._commands.keys():
            self.log.warning("Can not unregister command %s" % command)
        else:
            # Click does not have any kind of a function to unregister/remove/deactivate already added commands.
            # So we need to delete the related objects manually from the click internal commands dictionary for
            # our root command.
            del(self._click_root_command.commands[command])
            # Finally lets delete the command from our internal dictionary too.
            del(self._commands[command])
            self.log.debug("Command %s got unregistered" % command)
812061
static function clear_running_commands($command = null)
    {
        if (empty($command)){
            self::$running_commands = [];
        }else
        if (array_key_exists($command, self::$running_commands)){
            unset(self::$running_commands, $command);
        }
    }
57511
@ObjectiveCName("doCallWithGid:")
    public Command<Long> doGroupCall(int gid) {
        return modules.getCallsModule().makeCall(Peer.group(gid), false);
    }
370858
function(aggregate, vm, callback) {
                self.validate(cmd.command, cmd.payload, function(err) {
                    callback(err, aggregate, vm);
                });
            }
765551
protected void fireCommandRegistered(AbstractCommand command) {
        
        Assert.notNull(command, "command");
        
        if (commandRegistryListeners.isEmpty()) {
            return;
        }
        
        CommandRegistryEvent event = new CommandRegistryEvent(this, command);
        
        for (Iterator i = commandRegistryListeners.iterator(); i.hasNext();) {
            ((CommandRegistryListener)i.next()).commandRegistered(event);
        }
        
    }
513073
function (aggId) {
    if (!aggId || !_.isString(aggId)) {
      var err = new Error('Please pass a valid aggregate id!');
      debug(err);
      throw err;
    }

    if (this.queue[aggId] && this.queue[aggId].length > 0) {
      var nextCmd = this.queue[aggId][0];
      return nextCmd;
    }

    return null;
  }
32656
public function channelGroupPermRemove($cgid, $permid)
  {
    if(!is_array($permid))
    {
      $permident = (is_numeric($permid)) ? "permid" : "permsid";
    }
    else
    {
      $permident = (is_numeric(current($permid))) ? "permid" : "permsid";
    }

    $this->execute("channelgroupdelperm", array("cgid" => $cgid, $permident => $permid));
  }