"Add" the task, not possible for QueueEmailTask

@return void
5628
public function add() {
		$this->err('Queue Email Task cannot be added via Console.');
		$this->out('Please use createJob() on the QueuedTask Model to create a Proper Email Task.');
		$this->out('The Data Array should look something like this:');
		$this->out(var_export([
			'settings' => [
				'to' => 'email@example.com',
				'subject' => 'Email Subject',
				'from' => 'system@example.com',
				'template' => 'sometemplate',
			],
			'content' => 'hello world',
		], true));
		$this->out('Alternativly, you can pass the whole EmailLib to directly use it.');
	}
122462
protected function loadCronBatch(\Gems_Task_TaskRunnerBatch $batch)
    {
       $batch->addMessage(sprintf($this->_("Starting %s mail jobs"), $this->project->getName()));
       $batch->addTask('Mail\\AddAllMailJobsTask');

        // Check for unprocessed tokens, 
       $tracker = $this->loader->getTracker();
       $tracker->loadCompletedTokensBatch($batch, null, $this->currentUser->getUserId());
   }
1085020
private function addContactToQueue()
    {
        if (
            !$this->queue
            && $this->file
            && $this->contactClient
            && $this->contact
        ) {
            // Check for a pre-existing instance of this contact queued for this file.
            $queue = $this->getQueueRepository()->findOneBy(
                [
                    'contactClient' => $this->contactClient,
                    'file'          => $this->file,
                    'contact'       => (int) $this->contact->getId(),
                ]
            );
            if ($queue) {
                throw new ContactClientException(
                    'Skipping duplicate Contact. Already queued for file delivery.',
                    Codes::HTTP_CONFLICT,
                    null,
                    Stat::TYPE_DUPLICATE,
                    false,
                    $queue
                );
            } else {
                /** @var Queue $queue */
                $queue = new Queue();
                $queue->setContactClient($this->contactClient);
                $queue->setContact($this->contact);
                $queue->setFile($this->file);

                if (!empty($this->event['id'])) {
                    $queue->setCampaignEvent($this->event['id']);
                }
                if ($this->campaign) {
                    $queue->setCampaign($this->campaign);
                }
                if ($queue) {
                    $this->queue = $queue;
                    $this->getQueueRepository()->saveEntity($this->queue);
                    $this->valid = true;
                    $this->setLogs($this->queue->getId(), 'queueId');
                }
            }
        }

        if (!$this->queue) {
            throw new ContactClientException(
                'Could not append this contact to the queue.',
                Codes::HTTP_INTERNAL_SERVER_ERROR,
                isset($e) ? $e : null,
                Stat::TYPE_ERROR,
                false
            );
        }

        return $this->queue;
    }
320436
private function addTasks($tasks = null)
    {
        //====================================================================//
        // No tasks to Add
        if (is_null($tasks) && empty($this->tasks)) {
            return true;
        }

        //====================================================================//
        // Prepare Tasks To Perform
        //====================================================================//

        //====================================================================//
        // Add Internal Tasks to buffer
        if (!empty($this->tasks)) {
            $this->outputs->tasks = $this->tasks;
            $this->outputs->taskscount = count($this->outputs->tasks);
            Splash::log()->deb('[WS] Call Loaded '.$this->outputs->tasks->count().' Internal tasks');
        } else {
            $this->outputs->tasks = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);
        }

        //====================================================================//
        // Add External Tasks to the request
        if (!empty($tasks)) {
            $this->outputs->tasks->append($tasks);
            $this->outputs->taskscount = count($tasks);
            Splash::log()->deb('[WS] Call Loaded '.count($tasks).' External tasks');
        }

        return true;
    }
703424
private function add()
    {
        $action = $this->arg->getParameter('action');

        if (!in_array($action, static::ACTION)) {
            $this->throwFailsCommand('This action is not exists', 'help add');
        }
        
        $this->command->call(
            'generate',
            $action,
            $this->arg->getParameter('target')
        );
    }
741947
protected void addTask(Runnable task) {
        if (task == null) {
            throw new NullPointerException("task");
        }
        if (!offerTask(task)) {
            reject(task);
        }
    }
140419
public function initialize()
    {
        $paths = App::path('Shell/Task', 'CodeBlastrQueue');
        foreach ($paths as $path) {
            $Folder = new Folder($path);
            $res = array_merge($this->tasks, $Folder->find('Queue.+\.php'));
            foreach ($res as &$r) {
                $r = 'CodeBlastrQueue.' . basename($r, 'Task.php');
            }
            $this->tasks = $res;
        }
        parent::initialize();
    }
771867
def add(self, arg, options=None):
    
    fut = tasklets.Future('%s.add(%s, %s)' % (self, arg, options))
    todo = self._queues.get(options)
    if todo is None:
      utils.logging_debug('AutoBatcher(%s): creating new queue for %r',
                          self._todo_tasklet.__name__, options)
      if not self._queues:
        eventloop.add_idle(self._on_idle)
      todo = self._queues[options] = []
    todo.append((fut, arg))
    if len(todo) >= self._limit:
      del self._queues[options]
      self.run_queue(options, todo)
    return fut
999750
public function push()
    {
        if (!is_callable(self::$howToUseQueue)) {
            throw new PhpSmsException('Expected define how to use the queue system by methods `queue`.');
        }
        try {
            $this->pushedToQueue = true;

            return call_user_func_array(self::$howToUseQueue, [$this, $this->all()]);
        } catch (\Exception $e) {
            $this->pushedToQueue = false;
            throw $e;
        }
    }
350652
def add_task(self, func, *args, **kargs):
        
        self.tasks_queue.put((func, args, kargs))
645190
public function addTaskDefinition($name, $class, $classpath = null)
    {
        if ($class === "") {
            $this->project->log("Task $name has no class defined.", Project::MSG_ERR);
        } elseif (!isset($this->taskdefs[$name])) {
            Phing::import($class, $classpath);
            $this->taskdefs[$name] = $class;
            $this->project->log("  +Task definition: $name ($class)", Project::MSG_DEBUG);
        } else {
            $this->project->log("Task $name ($class) already registered, skipping", Project::MSG_VERBOSE);
        }
    }
129945
public static function queue_task($userid) {
        // Let's set up the adhoc task.
        $task = new \core_message\task\migrate_message_data();
        $task->set_custom_data(
            [
                'userid' => $userid
            ]
        );

        // Queue it.
        \core\task\manager::queue_adhoc_task($task, true);
    }
948992
public function main()
    {
        Configure::write('App.baseUrl', '/');

        $conditions = [];
        if ($this->args) {
            $conditions['id IN'] = $this->args;
        }

        $emailQueue = TableRegistry::get('EmailQueue', ['className' => EmailQueueTable::class]);
        $emails = $emailQueue->find()->where($conditions)->toList();

        if (!$emails) {
            $this->out('No emails found');

            return;
        }

        $this->clear();
        foreach ($emails as $i => $email) {
            if ($i) {
                $this->in('Hit a key to continue');
                $this->clear();
            }
            $this->out('Email :' . $email['EmailQueue']['id']);
            $this->preview($email);
        }
    }
709568
function Tasks() {
		this.tasks = [];
		this.add = function(task) {
			var commit = grunt.config.get('releasebot.commit');
			if (commit.skipTaskCheck(task)) {
				grunt.log.writeln('Skipping "' + task + '" task');
				return false;
			}
			// grunt.log.writeln('Queuing "' + task + '" task');
			return this.tasks.push(task);
		};
	}
990854
private function outputTaskStack() {
        foreach ($this->taskStack as $indent => &$task) {
            list($taskLevel, $taskMessage, $taskContext, $taskOutput) = $task;
            if (!$taskOutput) {
                $this->logInternal($taskLevel, $taskMessage, [self::FIELD_INDENT => $indent] + $taskContext);

                $task[3] = true; // mark task as outputted
            }
        }
    }
1326240
public function addConsoleCommands()
    {
        $this->getConsole()->addUserArgumentsAndOptions();

        foreach ($this->tasks as $name => $task) {
            if ($task->isPrivate()) {
                continue;
            }

            $this->getConsole()->add(new TaskCommand($name, $task->getDescription(), $this));
        }
    }
1234216
def add_task(self, task, parent_task_result):
        
        self.tasks.append((task, parent_task_result))
        self.task_id_to_task[task.id] = task