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_URLto 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_URLis 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hyrex-0.9.8.tar.gz.
File metadata
- Download URL: hyrex-0.9.8.tar.gz
- Upload date:
- Size: 60.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08bd7d78106d2d0bad81abfe16da0ea21eb52ab5a574b2e77c18a33b1896fc6c
|
|
| MD5 |
730ea748d4872de3381f33d21a7bf2c2
|
|
| BLAKE2b-256 |
030117561a9b7521fe7a5e3ee7278117b50bec836b3e5b54f30c64a8d7e5867d
|
File details
Details for the file hyrex-0.9.8-py3-none-any.whl.
File metadata
- Download URL: hyrex-0.9.8-py3-none-any.whl
- Upload date:
- Size: 77.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22cfe83f24a61467dd6af50fd8670b8d47a8a0d0dd6ad04ce425edc76be7612c
|
|
| MD5 |
cdd2182328b9529c505a0a928954a910
|
|
| BLAKE2b-256 |
60133d73cae1e709cfa3c4a4a27a3761e86e2c165df0d86be9b6655599c09358
|