Skip to main content

Hyrex is the open-source COLD task orchestration framework built on Postgres.

Project description

hyrex-sdk

Hyrex is a modern, open-source task orchestration framework.

Installation

pip install hyrex

Running on your own infra:

Step 1: Database initialization

  • Set HYREX_DATABASE_URL to your Postgres database connection string
  • Run hyrex init-db

Step 2: Decorate your tasks

  • Instantiate a Hyrex object wherever your tasks are defined:
from hyrex import Hyrex

hy = Hyrex(app_id="my-hyrex-app")
  • Decorate your task:
def NameContext(BaseModel):
    name: str


@hy.task
def say_name(context: NameContext):
    print(context.name)
  • Send your task to the Hyrex queue. A worker will pick it up from there.
say_name.send(NameContext(name="Bob"))

Step 3: Run your worker(s)

  • Make sure HYREX_DATABASE_URL is set.
  • Update this command with the module path to your Hyrex instance:
hyrex run-worker my_app.tasks:hy

Logging

Hyrex uses Python's logging module for logging info about task queueing, worker status, etc. By default, logs are displayed at the INFO level. To adjust the logging level or disable logs, configure this in your application. For example:

import logging
# To change to DEBUG level
logging.basicConfig(level=logging.DEBUG)

# To disable logs
logging.getLogger("hyrex").setLevel(logging.CRITICAL)

To configure Hyrex logs only:

logger = logging.getLogger("hyrex")
# Change log level
logger.setLevel(logging.DEBUG)
# Or disable logs
logger.setLevel(logging.CRITICAL)

Handlers and formatting options from the logging module are also supported.

For worker processes, the logging level can be set using the log-level flag on the hyrex run-worker CLI command.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hyrex-0.9.14.tar.gz (62.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hyrex-0.9.14-py3-none-any.whl (79.3 kB view details)

Uploaded Python 3

File details

Details for the file hyrex-0.9.14.tar.gz.

File metadata

  • Download URL: hyrex-0.9.14.tar.gz
  • Upload date:
  • Size: 62.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.3

File hashes

Hashes for hyrex-0.9.14.tar.gz
Algorithm Hash digest
SHA256 df0e07944ea0bb6e5ad4046426e5abde67ebe2cc5d640806943c485abd125554
MD5 470bed2c464302aca9526241cec9c08f
BLAKE2b-256 e00bf18cb04dec0b181c52b220d558d05f3802a4cfe1b30c969d355c02bfab2f

See more details on using hashes here.

File details

Details for the file hyrex-0.9.14-py3-none-any.whl.

File metadata

  • Download URL: hyrex-0.9.14-py3-none-any.whl
  • Upload date:
  • Size: 79.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.3

File hashes

Hashes for hyrex-0.9.14-py3-none-any.whl
Algorithm Hash digest
SHA256 6855e6d02f578a43cd5a67eac3f382e112388a68f8d7d5d725f62645742d5a83
MD5 1ef424aa1938e99d198e4f66b2997ae0
BLAKE2b-256 302e95c1f6f324338a6add1332084b6e54c7617af56b7891d7c7a6d54827e673

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page