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, no logs are displayed. To turn on logs, configure this in your application. For example:

import logging
logging.basicConfig(level=logging.INFO)

To configure Hyrex logs only:

logger = logging.getLogger("hyrex")
logger.setLevel(logging.INFO)

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.8.0.tar.gz (28.8 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.8.0-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hyrex-0.8.0.tar.gz
  • Upload date:
  • Size: 28.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for hyrex-0.8.0.tar.gz
Algorithm Hash digest
SHA256 88affd096e41d6c340bdeac90d91bf516658ea5ce2f621fa796f36af4bb7e121
MD5 f876977e6e2e9317d5c50bff07f224e3
BLAKE2b-256 2d4950d0b59256ce75e0985b9acf37f583a0a2d75e78eef1c1d544612cff41ce

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hyrex-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 34.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for hyrex-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1a41928951945dc420ccb3cb692996a048648c425f11d8391323b87af71cb27
MD5 3f5eb22f08f58c4a03e27300ef9dbea9
BLAKE2b-256 c94904bc3a71fac36d3073b2eb88f512648a9f6f43a1dbf18ae7c1201045197b

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