Skip to main content

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


Download files

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

Source Distribution

workerz-0.0.1.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

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

workerz-0.0.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file workerz-0.0.1.tar.gz.

File metadata

  • Download URL: workerz-0.0.1.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

Hashes for workerz-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3e57e138ef948c695f361d6cb839ec00d9c6860c00108308e64afa6c73a99735
MD5 6c48ee4af725c97cc3c86ec9c4d6fbdf
BLAKE2b-256 bc673203437017d3bb2a6334642cd9a814647ed1c439f2fbe077de449195232c

See more details on using hashes here.

Provenance

The following attestation bundles were made for workerz-0.0.1.tar.gz:

Publisher: publish.yml on achaayb/workerz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file workerz-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: workerz-0.0.1-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

Hashes for workerz-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bab7c86ed2a7f24a5335aec615699dbc0ce5741100f905adb201aa27db7c07c5
MD5 4f3f4f85b30f9a859e49cb9f9cb50c9e
BLAKE2b-256 baf6f73802c94937a6f2c0fcf6659a60a72bd84c0b960ecc0624b83d2171c80a

See more details on using hashes here.

Provenance

The following attestation bundles were made for workerz-0.0.1-py3-none-any.whl:

Publisher: publish.yml on achaayb/workerz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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