Skip to content

HeyItWorked/foreman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

foreman

A minimal async task queue inspired by Celery — built from scratch with Tokio and Axum.

Goals

  • Learn tokio::sync primitives: channels, semaphores
  • Build a concurrent worker pool with bounded parallelism
  • Handle job retries with exponential backoff
  • Ship a real HTTP API with axum

Running

cargo run

The server listens on http://localhost:3000.

API

Submit a job

curl -X POST http://localhost:3000/jobs \
  -H "content-type: application/json" \
  -d '{"kind": "echo", "data": {"msg": "hello"}}'
# → {"id": "<uuid>"}

Check status

curl http://localhost:3000/jobs/<id>

List all jobs

curl http://localhost:3000/jobs
curl "http://localhost:3000/jobs?status=completed"

Cancel a queued job

curl -X DELETE http://localhost:3000/jobs/<id>

Built-in job kinds

kind data fields what it does
echo any returns the payload unchanged
sleep ms (number) sleeps N milliseconds, returns {slept_ms}
fail any always errors (for testing retry)

Status

Work in progress — not production ready.

About

A minimal async task queue inspired by Celery

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

No contributors

Languages