Skip to content

Instantly share code, notes, and snippets.

@ryandotsmith
Last active December 11, 2015 18:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryandotsmith/4641301 to your computer and use it in GitHub Desktop.
Save ryandotsmith/4641301 to your computer and use it in GitHub Desktop.
Komrade's HTTP API

Komrade

Komrade is a message queue for your workers. Komrade will help you manage background jobs for web applications.

HTTP based queueing service.

  • PUT Job
  • POST Job's Heartbeat
  • PUT Job Failure
  • GET Jobs
  • DELETE Job
  • POST Delete All Jobs

PUT Job

> PUT https://service-1.komrade.io/jobs/:uuid
> Authorization: b64
> {"payload": {}}
< {"id": id, "payload": {}}

POST Job's Heartbeat

> POST https://service-1.komrade.io/jobs/:uuid/heartbeats
> Authorization: b64
< {"message": "OK"}

PUT Job Failure

> PUT https://service-1.komrade.io/jobs/:uuid/failures/:failure-id
> Authorization: b64
> {"error": "DBError", "message": "Table does not exist."}
< {"id": failure-id}

GET Jobs

> GET https://service-1.komrade.io/jobs?limit=1
> Authorization: b64
< [{"id": id, "payload": {}}]

DELETE Job

> DELETE https://service-1.komrade.io/jobs/:uuid
> Authorization: b64
< [{"id": id}]

POST Delete All Jobs

> POST https://service-1.komrade.io/delete-all-jobs
> Authorization: b64
< {"deleted": 42}

POST Worker's Heartbeat

> POST https://service-1.komrade.io/workers/:uuid/heartbeats
> Authorization: b64
< {"msg": "OK"}

Clients

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment