taraqueue package

Subpackages

Submodules

taraqueue.memory module

Memory queue implementation.

class taraqueue.memory.MemoryQueue(topics: list = <factory>, queues: dict = <factory>)

Bases: Queue

classmethod from_url(url: URL) MemoryQueue
async publish(topic: str, message: str) None

See Queue.publish.

queues: dict
async receive(timeout=None) str

See Queue.receive.

async subscribe(topic: str) None

See Queue.subscribe.

topics: list
async unsubscribe(topic: str) None

See Queue.unsubscribe.

taraqueue.redis module

Redis queue implementation.

class taraqueue.redis.RedisQueue(client: redis.asyncio.client.Redis, pubsub: redis.asyncio.client.PubSub)

Bases: Queue

client: Redis
classmethod from_env(env=environ({'ACCEPT_EULA': 'Y', 'ACTIONS_ORCHESTRATION_ID': '8deeebbc-c6eb-45c7-b496-99a082b8c7c0.docs.__default', 'ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE': '/opt/actionarchivecache', 'AGENT_TOOLSDIRECTORY': '/opt/hostedtoolcache', 'ANDROID_HOME': '/usr/local/lib/android/sdk', 'ANDROID_NDK': '/usr/local/lib/android/sdk/ndk/27.3.13750724', 'ANDROID_NDK_HOME': '/usr/local/lib/android/sdk/ndk/27.3.13750724', 'ANDROID_NDK_LATEST_HOME': '/usr/local/lib/android/sdk/ndk/29.0.14206865', 'ANDROID_NDK_ROOT': '/usr/local/lib/android/sdk/ndk/27.3.13750724', 'ANDROID_SDK_ROOT': '/usr/local/lib/android/sdk', 'ANT_HOME': '/usr/share/ant', 'AZURE_EXTENSION_DIR': '/opt/az/azcliextensions', 'BOOTSTRAP_HASKELL_NONINTERACTIVE': '1', 'CHROMEWEBDRIVER': '/usr/local/share/chromedriver-linux64', 'CHROME_BIN': '/usr/bin/google-chrome', 'CI': 'true', 'CONDA': '/usr/share/miniconda', 'DEBIAN_FRONTEND': 'noninteractive', 'DOTNET_MULTILEVEL_LOOKUP': '0', 'DOTNET_NOLOGO': '1', 'DOTNET_SKIP_FIRST_TIME_EXPERIENCE': '1', 'EDGEWEBDRIVER': '/usr/local/share/edge_driver', 'ENABLE_RUNNER_TRACING': 'true', 'GECKOWEBDRIVER': '/usr/local/share/gecko_driver', 'GHCUP_INSTALL_BASE_PREFIX': '/usr/local', 'GITHUB_ACTION': '__run', 'GITHUB_ACTIONS': 'true', 'GITHUB_ACTION_REF': '', 'GITHUB_ACTION_REPOSITORY': '', 'GITHUB_ACTOR': 'cr3', 'GITHUB_ACTOR_ID': '1476750', 'GITHUB_API_URL': 'https://api.github.com', 'GITHUB_BASE_REF': '', 'GITHUB_ENV': '/home/runner/work/_temp/_runner_file_commands/set_env_fcef373f-4589-438a-85ab-9b5dc71bd783', 'GITHUB_EVENT_NAME': 'push', 'GITHUB_EVENT_PATH': '/home/runner/work/_temp/_github_workflow/event.json', 'GITHUB_GRAPHQL_URL': 'https://api.github.com/graphql', 'GITHUB_HEAD_REF': '', 'GITHUB_JOB': 'docs', 'GITHUB_OUTPUT': '/home/runner/work/_temp/_runner_file_commands/set_output_fcef373f-4589-438a-85ab-9b5dc71bd783', 'GITHUB_PATH': '/home/runner/work/_temp/_runner_file_commands/add_path_fcef373f-4589-438a-85ab-9b5dc71bd783', 'GITHUB_REF': 'refs/tags/v0.4.0', 'GITHUB_REF_NAME': 'v0.4.0', 'GITHUB_REF_PROTECTED': 'false', 'GITHUB_REF_TYPE': 'tag', 'GITHUB_REPOSITORY': 'taradix/taraqueue', 'GITHUB_REPOSITORY_ID': '1226869807', 'GITHUB_REPOSITORY_OWNER': 'taradix', 'GITHUB_REPOSITORY_OWNER_ID': '276602703', 'GITHUB_RETENTION_DAYS': '90', 'GITHUB_RUN_ATTEMPT': '1', 'GITHUB_RUN_ID': '25506854840', 'GITHUB_RUN_NUMBER': '8', 'GITHUB_SERVER_URL': 'https://github.com', 'GITHUB_SHA': '587771e8a5ba715d4cc1ba30cf87741a0edef609', 'GITHUB_STATE': '/home/runner/work/_temp/_runner_file_commands/save_state_fcef373f-4589-438a-85ab-9b5dc71bd783', 'GITHUB_STEP_SUMMARY': '/home/runner/work/_temp/_runner_file_commands/step_summary_fcef373f-4589-438a-85ab-9b5dc71bd783', 'GITHUB_TRIGGERING_ACTOR': 'cr3', 'GITHUB_WORKFLOW': 'Publish', 'GITHUB_WORKFLOW_REF': 'taradix/taraqueue/.github/workflows/publish.yml@refs/tags/v0.4.0', 'GITHUB_WORKFLOW_SHA': '587771e8a5ba715d4cc1ba30cf87741a0edef609', 'GITHUB_WORKSPACE': '/home/runner/work/taraqueue/taraqueue', 'GOROOT_1_22_X64': '/opt/hostedtoolcache/go/1.22.12/x64', 'GOROOT_1_23_X64': '/opt/hostedtoolcache/go/1.23.12/x64', 'GOROOT_1_24_X64': '/opt/hostedtoolcache/go/1.24.13/x64', 'GOROOT_1_25_X64': '/opt/hostedtoolcache/go/1.25.9/x64', 'GRADLE_HOME': '/usr/share/gradle-9.4.1', 'HOME': '/home/runner', 'HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS': '3650', 'HOMEBREW_NO_AUTO_UPDATE': '1', 'INVOCATION_ID': 'c11e461a278c4e2db4d5d17a1d1935d1', 'ImageOS': 'ubuntu24', 'ImageVersion': '20260413.86.1', 'JAVA_HOME': '/usr/lib/jvm/temurin-17-jdk-amd64', 'JAVA_HOME_11_X64': '/usr/lib/jvm/temurin-11-jdk-amd64', 'JAVA_HOME_17_X64': '/usr/lib/jvm/temurin-17-jdk-amd64', 'JAVA_HOME_21_X64': '/usr/lib/jvm/temurin-21-jdk-amd64', 'JAVA_HOME_25_X64': '/usr/lib/jvm/temurin-25-jdk-amd64', 'JAVA_HOME_8_X64': '/usr/lib/jvm/temurin-8-jdk-amd64', 'JOURNAL_STREAM': '9:13694', 'LANG': 'C.UTF-8', 'LD_LIBRARY_PATH': '/opt/hostedtoolcache/Python/3.12.13/x64/lib', 'LOGNAME': 'runner', 'MAKEFLAGS': '', 'MAKELEVEL': '1', 'MEMORY_PRESSURE_WATCH': '/sys/fs/cgroup/system.slice/hosted-compute-agent.service/memory.pressure', 'MEMORY_PRESSURE_WRITE': 'c29tZSAyMDAwMDAgMjAwMDAwMAA=', 'MFLAGS': '', 'NVM_DIR': '/home/runner/.nvm', 'PATH': '/home/runner/work/taraqueue/taraqueue/.venv/bin:/home/runner/work/_temp/uv-python-dir:/opt/hostedtoolcache/uv/0.11.11/x86_64:/home/runner/.local/bin:/opt/hostedtoolcache/Python/3.12.13/x64/bin:/opt/hostedtoolcache/Python/3.12.13/x64:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin', 'PIPX_BIN_DIR': '/opt/pipx_bin', 'PIPX_HOME': '/opt/pipx', 'PKG_CONFIG_PATH': '/opt/hostedtoolcache/Python/3.12.13/x64/lib/pkgconfig', 'POWERSHELL_DISTRIBUTION_CHANNEL': 'GitHub-Actions-ubuntu24', 'PSModulePath': '/root/.local/share/powershell/Modules:/usr/local/share/powershell/Modules:/opt/microsoft/powershell/7/Modules:/usr/share/az_14.6.0', 'PWD': '/home/runner/work/taraqueue/taraqueue', 'Python2_ROOT_DIR': '/opt/hostedtoolcache/Python/3.12.13/x64', 'Python3_ROOT_DIR': '/opt/hostedtoolcache/Python/3.12.13/x64', 'Python_ROOT_DIR': '/opt/hostedtoolcache/Python/3.12.13/x64', 'RELEASE_VERSION': 'v0.4.0', 'RUNNER_ARCH': 'X64', 'RUNNER_ENVIRONMENT': 'github-hosted', 'RUNNER_NAME': 'GitHub Actions 1000006809', 'RUNNER_OS': 'Linux', 'RUNNER_TEMP': '/home/runner/work/_temp', 'RUNNER_TOOL_CACHE': '/opt/hostedtoolcache', 'RUNNER_TRACKING_ID': 'github_08217fef-469d-436e-a985-fc2482903c36', 'RUNNER_WORKSPACE': '/home/runner/work/taraqueue', 'SELENIUM_JAR_PATH': '/usr/share/java/selenium-server.jar', 'SGX_AESM_ADDR': '1', 'SHELL': '/bin/bash', 'SHLVL': '1', 'SWIFT_PATH': '/usr/share/swift/usr/bin', 'SYSTEMD_EXEC_PID': '2029', 'USER': 'runner', 'USE_BAZEL_FALLBACK_VERSION': 'silent:', 'UV': '/opt/hostedtoolcache/uv/0.11.11/x86_64/uv', 'UV_CACHE_DIR': '/home/runner/work/_temp/setup-uv-cache', 'UV_PYTHON': '3.12', 'UV_PYTHON_INSTALL_DIR': '/home/runner/work/_temp/uv-python-dir', 'UV_RUN_RECURSION_DEPTH': '1', 'VCPKG_INSTALLATION_ROOT': '/usr/local/share/vcpkg', 'VIRTUAL_ENV': '/home/runner/work/taraqueue/taraqueue/.venv', 'XDG_CONFIG_HOME': '/home/runner/.config', 'XDG_RUNTIME_DIR': '/run/user/1001', '_': '/usr/bin/make', 'pythonLocation': '/opt/hostedtoolcache/Python/3.12.13/x64', 'DOCUTILSCONFIG': '/home/runner/work/taraqueue/taraqueue/docs/docutils.conf'})) RedisQueue
classmethod from_host(host: str, port: int = 6379, password: str | None = None) RedisQueue
classmethod from_url(url: URL | str) RedisQueue
async publish(topic: str, message: str) None

See Queue.publish.

pubsub: PubSub
async receive(timeout=0) str

See Queue.receive.

async subscribe(topic: str) None

See Queue.subscribe.

async unsubscribe(topic: str) None

See Queue.unsubscribe.

taraqueue.registry module

Entry points based registry management.

taraqueue.registry.get_entry_points(group)

Get the list of pytest_unique entry points.

taraqueue.registry.registry_add(group, name, entry, registry=None)

Add an entry to a registry.

Parameters:
  • group – Group of the entry.

  • name – Name of the entry.

  • entry – Entry to add.

  • registry – Optional registry to update.

Returns:

A registry with the entry.

taraqueue.registry.registry_get(group, name, registry=None)

Get an entry from a registry.

If the registry is not defined or the group is not in the registry, the registry is loaded again.

Parameters:
  • group – Group of the entry.

  • name – Name of the entry.

  • registry – Optional registry to get from.

Raises:

KeyError – If not found.

taraqueue.registry.registry_load(group, registry=None)

Find all installed entry points.

taraqueue.registry.registry_remove(group, name, registry=None)

Remove an entry from a registry.

If the entry doesn’t exist, return silently.

Parameters:
  • group – Group of the entry.

  • name – Name of the entry.

  • registry – Optional registry to update.

Module contents

Queue abstraction.

class taraqueue.Queue

Bases: ABC

Base queue class.

connect(topic: str)

Context manager that subscribes on entry and unsubscribes on exit.

classmethod from_url(url: URL | str, registry=None) Queue
abstractmethod async publish(topic: str, message: str) None

Publish a message to a topic.

abstractmethod async receive(timeout=None) str

Listen for messages on the subscribed topics.

abstractmethod async subscribe(topic: str) None

Subscribe to a topic before receiving messages.

abstractmethod async unsubscribe(topic: str) None

Unsubscribe from a topic after receiving messages.

exception taraqueue.QueueEmpty

Bases: Exception

Raised when the queue is empty.