@control_command()
def disable_events(state):
 dispatcher = state.consumer.event_dispatcher
 if (u'task' in dispatcher.groups):
  dispatcher.groups.discard(u'task')
  logger.info(u'Events of group {task} disabled by remote.')
  return ok(u'task events disabled')
 return ok(u'task events already disabled')

@ control_command ( ) def disable_events ( state ) : dispatcher = state . consumer . event_dispatcher if ( u'task' in dispatcher . groups ) : dispatcher . groups . discard ( u'task' ) logger . info ( u'Events of group {task} disabled by remote.' ) return ok ( u'task events disabled' ) return ok ( u'task events already disabled' )
tell worker(s) to stop sending task-related events .