---
url: "https://vueda.dev/v3/reference/api/py/vueda.vdq.tasks/QueueProcessor.md"
title: "QueueProcessor"
---

# QueueProcessor

## Overview

Runs a task body inside one named action context.

Delivery writes to several tables per message and has no request to take a context from, so
without this each write would record an event that nothing associates with the rest.

## `on_failure` {#on_failure}

Error handler.

This is run by the worker when the task fails.

Arguments:
    exc (Exception): The exception raised by the task.
    task_id (str): Unique id of the failed task.
    args (Tuple): Original arguments for the task that failed.
    kwargs (Dict): Original keyword arguments for the task that failed.
    einfo (~billiard.einfo.ExceptionInfo): Exception information.

Returns:
    None: The return value of this handler is ignored.

### Signature {#on_failure-signature}

`on_failure(self, exc, task_id, args, kwargs, einfo)`

#### Parameters {#on_failure-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| self |  | yes |  |  |
| <span id="on_failure-param-exc">exc</span> |  | yes |  |  |
| <span id="on_failure-param-task_id">task_id</span> |  | yes |  |  |
| <span id="on_failure-param-args">args</span> |  | yes |  |  |
| <span id="on_failure-param-kwargs">kwargs</span> |  | yes |  |  |
| <span id="on_failure-param-einfo">einfo</span> |  | yes |  |  |

### Source {#on_failure-source}

`server/vueda/vdq/tasks.py:96`

## `on_retry` {#on_retry}

Retry handler.

This is run by the worker when the task is to be retried.

Arguments:
    exc (Exception): The exception sent to :meth:`retry`.
    task_id (str): Unique id of the retried task.
    args (Tuple): Original arguments for the retried task.
    kwargs (Dict): Original keyword arguments for the retried task.
    einfo (~billiard.einfo.ExceptionInfo): Exception information.

Returns:
    None: The return value of this handler is ignored.

### Signature {#on_retry-signature}

`on_retry(self, exc, task_id, args, kwargs, einfo)`

#### Parameters {#on_retry-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| self |  | yes |  |  |
| <span id="on_retry-param-exc">exc</span> |  | yes |  |  |
| <span id="on_retry-param-task_id">task_id</span> |  | yes |  |  |
| <span id="on_retry-param-args">args</span> |  | yes |  |  |
| <span id="on_retry-param-kwargs">kwargs</span> |  | yes |  |  |
| <span id="on_retry-param-einfo">einfo</span> |  | yes |  |  |

### Source {#on_retry-source}

`server/vueda/vdq/tasks.py:67`

## Source

`server/vueda/vdq/tasks.py:66`
