arq Documentation

repository·main·Indexed 25 days ago

https://github.com/python-arq/arq

An asynchronous job queue library for Python that leverages asyncio and Redis to manage and execute background tasks. Currently in maintenance only mode.

Tokens
395
Snippets
0
Records
4
Agent score
34%

What's inside arq

  1. Overview of arq

    main

    arq is a job queue library for Python built using asyncio and redis. It allows for asynchronous task execution and management via Redis-backed queues.

    Note: The project is currently in maintenance only mode.

  2. Watch and reload worker on file changes

    main

    To enable hot-reloading during development, use the --watch flag followed by the directory path you want to monitor.

    Requirements:

    • You must have watchfiles installed: pip install watchfiles.

    When a file change is detected in the specified directory, the worker will receive a SIGUSR1 signal to reload, close the current worker instance, and start a new one.

  3. Check worker health via CLI

    main
    Use the --check flag with the arq command to perform a health check on your worker settings and then exit immediately. This is useful for verifying configuration and connectivity before starting a full worker process.
  4. Run the arq worker via CLI

    main

    Use the arq command to start a worker process. You must provide a string path to your WorkerSettings object (e.g., myapp.settings.WorkerSettings).

    Arguments:

    • worker-settings (required): The import path to your WorkerSettings class/object.

    Options:

    • --burst / --no-burst: Enables batch mode. The worker will exit once no more jobs are found in any queue.
    • --check: Runs a health check and then exits.
    • --watch <path>: Watches a directory and reloads the worker when files change. Requires the watchfiles package to be installed (pip install watchfiles).
    • -v, --verbose: Enables verbose output.
    • --custom-log-dict <path>: Provides an import path for a dictionary in logdict form to configure Arq's internal logging.