Delete the message after being processed by the worker.

@param TaskInterface $task
427425
public function delete(TaskInterface $task)
    {
        $this->doDelete($task->getMetadata('RdsMessageId'), [
            'InternalMessageId' => $task->getId(),
            'RdsMessageId' => $task->getMetadata('RdsMessageId')
        ]);
    }
493124
def task_delete(self, **kw):
        
        def validate(task):
            if task['status'] == Status.DELETED:
                raise ValueError("Task is already deleted.")

        return self._task_change_status(Status.DELETED, validate, **kw)
722253
public function setTask($task)
    {
        $taskCode = filter_var($task, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
        if (strpos($taskCode, '-') !== false) {
            $taskCode = str_replace('-', '', $taskCode);
        }
        $taskCode = $this->project . $taskCode;
        $this->task = $taskCode;
    }
1217554
public function destroy(TaskRequest $request, Task $task)
    {
        try {

            $task->delete();
            return $this->response->message(trans('messages.success.deleted', ['Module' => trans('task::task.name')]))
                ->code(202)
                ->status('success')
                ->url(guard_url('task/task'))
                ->redirect();

        } catch (Exception $e) {

            return $this->response->message($e->getMessage())
                ->code(400)
                ->status('error')
                ->url(guard_url('task/task/' . $task->getRouteKey()))
                ->redirect();
        }

    }
707411
protected function deleteQueueStorageFile(EntityInterface $taskLogEntity)
    {
        if ($filename = $taskLogEntity->getFileNameFromReport()) {
            $file = $this->getQueueStorage()
                ->getFile($filename);

            if($file->exists()) {
                $file->delete();
            }
        }

        return false;
    }
466998
private function deleteVary(RequestInterface $request)
    {
        $key = $this->getVaryKey($request);
        $this->cache->delete($key);
    }
1055918
public function delete($taskId)
    {
        if (!isset($this->tasks[$taskId])) {
            return false;
        }
        unset($this->tasks[$taskId]);
        return true;
    }
74320
private function deleteStats($worker)
    {
        $processed = sprintf('processed:%s', $worker);
        $failed = sprintf('failed:%s', $worker);
        $this->client->del([$processed, $failed]);
    }
866973
public void removeTask(ReceivedMessageTask task) {
        if (tasks.remove(task)) {
            task.cancelDeadlockFuture();
            if (listener != null) {
                listener.onTaskRemoved(this);
            }
        }
    }
964346
public function deleted(EntryInterface $entry)
    {
        $this->commands->dispatch(new DeleteTypeStream($entry));

        parent::deleted($entry);
    }
384387
public function afterDelete(Event $event, EntityInterface $entity) {
		if ($this->_checkEvent($event)) {
			$event->result = $this->_deleteFile($event);
			$event->stopPropagation();
		}
	}
22169
public static function scheduled_task_complete(scheduled_task $task) {
        global $DB;

        // Finalise the log output.
        logmanager::finalise_log();

        $classname = self::get_canonical_class_name($task);
        $record = $DB->get_record('task_scheduled', array('classname' => $classname));
        if ($record) {
            $record->lastruntime = time();
            $record->faildelay = 0;
            $record->nextruntime = $task->get_next_scheduled_time();

            $DB->update_record('task_scheduled', $record);
        }

        // Reschedule and then release the locks.
        if ($task->is_blocking()) {
            $task->get_cron_lock()->release();
        }
        $task->get_lock()->release();
    }
1022794
protected function submitTask(Task $task)
    {
        switch ($task->type) {
        case Task::JOB_LOW:
            $type = 'submit_job_low';
            break;
        case Task::JOB_LOW_BACKGROUND:
            $type = 'submit_job_low_bg';
            break;
        case Task::JOB_HIGH_BACKGROUND:
            $type = 'submit_job_high_bg';
            break;
        case Task::JOB_BACKGROUND:
            $type = 'submit_job_bg';
            break;
            case Task::JOB_EPOCH:
            $type = 'submit_job_epoch';
            break;
        case Task::JOB_HIGH:
            $type = 'submit_job_high';
            break;
        default:
            $type = 'submit_job';
            break;
        }

        $arg = $task->arg;

        $params = array(
            'func' => $task->func,
            'uniq' => $task->uniq,
            'arg' => $arg,
        );

        if ($task->type == Task::JOB_EPOCH) {
            $params['epoch'] = $task->epoch;
        }

        $s = $this->getConnection();
        Connection::send($s, $type, $params);

        if (!is_array(Connection::$waiting[(int) $s])) {
            Connection::$waiting[(int) $s] = array();
        }

        array_push(Connection::$waiting[(int) $s], $task);
    }
400091
public function deleteTask(int $taskId): bool
    {
        if ( ! $this->validateId($taskId)) {
            return false;
        }

        $result = $this->delete('tasks/' . $taskId);

        return 204 === $result->getStatusCode();
    }
606033
public function register_task($task)
    {
        if ($this->api->register_task($task, $this->ID)) {
            $this->mytask = $task;
        }
    }
328798
public static function deleteList($msg = '', $task = 'remove', $alt = 'JTOOLBAR_DELETE')
	{
		$bar = static::getRoot();
		// Add a delete button.
		if ($msg)
		{
			$bar->appendButton('Confirm', $msg, 'delete', $alt, $task, true);
		}
		else
		{
			$bar->appendButton('Standard', 'delete', $alt, $task, true);
		}
	}
599683
public static function adhoc_task_complete(adhoc_task $task) {
        global $DB;

        // Finalise the log output.
        logmanager::finalise_log();

        // Delete the adhoc task record - it is finished.
        $DB->delete_records('task_adhoc', array('id' => $task->get_id()));

        // Reschedule and then release the locks.
        if ($task->is_blocking()) {
            $task->get_cron_lock()->release();
        }
        $task->get_lock()->release();
    }