@control_command(variadic=u'task_id', signature=u'[id1 [id2 [... [idN]]]]')
def revoke(state, task_id, terminate=False, signal=None, **kwargs):
 (task_ids, task_id) = (set((maybe_list(task_id) or [])), None)
 size = len(task_ids)
 terminated = set()
 worker_state.revoked.update(task_ids)
 if terminate:
  signum = _signals.signum((signal or TERM_SIGNAME))
  for request in _find_requests_by_id(task_ids):
   if (request.id not in terminated):
    terminated.add(request.id)
    logger.info(u'Terminating %s (%s)', request.id, signum)
    request.terminate(state.consumer.pool, signal=signum)
    if (len(terminated) >= size):
     break
  if (not terminated):
   return ok(u'terminate: tasks unknown')
  return ok(u'terminate: {0}'.format(u', '.join(terminated)))
 idstr = u', '.join(task_ids)
 logger.info(u'Tasks flagged as revoked: %s', idstr)
 return ok(u'tasks {0} flagged as revoked'.format(idstr))

@ control_command ( variadic = u'task_id' , signature = u'[id1 [id2 [... [idN]]]]' ) def revoke ( state , task_id , terminate = False , signal = None , ** kwargs ) : ( task_ids , task_id ) = ( set ( ( maybe_list ( task_id ) or [ ] ) ) , None ) size = len ( task_ids ) terminated = set ( ) worker_state . revoked . update ( task_ids ) if terminate : signum = _signals . signum ( ( signal or TERM_SIGNAME ) ) for request in _find_requests_by_id ( task_ids ) : if ( request . id not in terminated ) : terminated . add ( request . id ) logger . info ( u'Terminating %s (%s)' , request . id , signum ) request . terminate ( state . consumer . pool , signal = signum ) if ( len ( terminated ) >= size ) : break if ( not terminated ) : return ok ( u'terminate: tasks unknown' ) return ok ( u'terminate: {0}' . format ( u', ' . join ( terminated ) ) ) idstr = u', ' . join ( task_ids ) logger . info ( u'Tasks flagged as revoked: %s' , idstr ) return ok ( u'tasks {0} flagged as revoked' . format ( idstr ) )
revoke task by task id .