Better Workers.
Project description
What is this and why im working on it
ive been dealing with workers for a long time now, from environments that require a simple set and forget to ones that require detailed logging, chains, very long running tasks etc..
celery is fine but its awkward, if you ever actually set it up you'll know what im talking about, late ack, base memory usage, config files not registering.. celery is robust but its too limiting and abstract for what i need.
you need a broker and a result backend, you need to figure out worker modes, flower?? .. thats before youve written a single line of business logic.
workerz is different in a few ways that actually matter.
workers pull nothing
the coordinator pushes. the moment a job comes in and a worker is idle, it gets dispatched. no polling interval, no prefetch tuning, no acks_late double edged sword.
labels instead of queues
you dont define queues and route tasks to them. you label workers with what they can do and label jobs with what they need. the coordinator finds the match.
labels are also dynamic. in celery if you need per-user dedicated workers you either create a queue per user or have your infra change env variables before worker startup.. with workerz you just set labels at runtime. think shared hosting vs actual dedicated hosting.
WORKERZ_LABELS=ml,gpu → this worker takes ml and gpu jobs
the result is always the same shape
{
"result": ...,
"error": null,
"warnings": [],
"infos": [],
"debug": []
}
structured logging
@task
def process(ctx, data):
ctx.info("starting")
ctx.warn("something looks off")
result = do_work(data)
ctx.debug(f"processed {len(result)} items")
return result
goes straight onto the job record. no log aggregation setup, no grep, no sentry integration required to see what your task was doing.
live metadata
tasks can push updates mid-run. useful for long running jobs where you want to track progress without polling logs.
@task
async def train(ctx, epochs):
for i in range(epochs):
loss = do_epoch(i)
await ctx.update(epoch=i, loss=loss, progress=f"{i}/{epochs}")
shows up on the job immediately. no separate progress tracking, no celery custom states workaround.
celery is probably still better for now.. but keep an eye on this.
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 workerz-0.0.7.tar.gz.
File metadata
- Download URL: workerz-0.0.7.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c731bf6f2e4b68c329f5fafd511902abe9b2db13cc0f82c9b5cccfe0340662d
|
|
| MD5 |
5aad66d678e554e92f165498d2ace2dc
|
|
| BLAKE2b-256 |
88e6db0158c742d3551296f7f048b8eba463d3b3e52e00e6807ab7f38ed68dc4
|
Provenance
The following attestation bundles were made for workerz-0.0.7.tar.gz:
Publisher:
publish.yml on achaayb/workerz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
workerz-0.0.7.tar.gz -
Subject digest:
2c731bf6f2e4b68c329f5fafd511902abe9b2db13cc0f82c9b5cccfe0340662d - Sigstore transparency entry: 1682123644
- Sigstore integration time:
-
Permalink:
achaayb/workerz@e3d6eabbe0ed55a52138fcf255f8671ae95a51f3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/achaayb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e3d6eabbe0ed55a52138fcf255f8671ae95a51f3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file workerz-0.0.7-py3-none-any.whl.
File metadata
- Download URL: workerz-0.0.7-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69f3c735591abfd40d6e77880eae58585174e5fcd2f76a6d48b5bda9e0254f7a
|
|
| MD5 |
9930c3ae6c44a67ca1a0d38e3dec3681
|
|
| BLAKE2b-256 |
a72e3231d99dc504ac3fb6d343fbe67ae794ffc5923d956c2eebb6200c54603c
|
Provenance
The following attestation bundles were made for workerz-0.0.7-py3-none-any.whl:
Publisher:
publish.yml on achaayb/workerz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
workerz-0.0.7-py3-none-any.whl -
Subject digest:
69f3c735591abfd40d6e77880eae58585174e5fcd2f76a6d48b5bda9e0254f7a - Sigstore transparency entry: 1682123977
- Sigstore integration time:
-
Permalink:
achaayb/workerz@e3d6eabbe0ed55a52138fcf255f8671ae95a51f3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/achaayb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e3d6eabbe0ed55a52138fcf255f8671ae95a51f3 -
Trigger Event:
workflow_dispatch
-
Statement type: