poussetaches (which literally means "push tasks" in French) is a lightweight asynchronous task execution service that aims
to replace Celery and RabbitMQ for small Python application.
The app posts base64-encoded payload to poussetaches and specify the endpoint that will be used to trigger the task by having
poussetaches making HTTP requests with the registered payload until the right status code is returned.
It works a bit like GCP Cloud Tasks/PubSub in push mode.
It's currently used by microblog.pub in production.
First, you need to setup a secret shared between you app and poussetaches, stored as en environment variable: POUSSETACHES_AUTH_KEY.
This key will be used by your app to ensure that only poussetaches is "executing tasks".
@app.route("task/my_task", methods=["POST"])
def task_my_task():
# Ensure poussetaches is the author of the request
if req.headers.get("Poussetaches-Auth-Key") != POUSSETACHES_AUTH_KEY:
raise ValueError("Bad auth key")
# Parse the "envelope" which contains metadata and the payload
envelope = json.loads(req.data)
print(req)
print(f"envelope={envelope!r}")
payload = json.loads(base64.b64decode(envelope["payload"]))
app.logger.info(envelope["req_id"])
app.logger.info(envelope["tries"])
app.logger.info(payload)
# Return a successfull status code to let pousssetaches knows the task is done
return ""
Returns the server status.
$ http get http://localhost:7991/
Queue a new task.
$ http post http://localhost:7991 url="http://httpbin.org/post" payload=`echo {"payload":"lol"} | base64`
Content type
Image
Digest
Size
307.2 MB
Last updated
almost 6 years ago
docker pull sorpaas/poussetaches