Fastapi, Celery, Task Queue, Websocket

FastAPI
Celery
Task queues
Web sockets
Jinja2 whitespace issues
Uvicorn import
Openapi.json client code generation
This article delves into the integration of FastAPI, Celery, and task queues with web sockets. It covers various topics like resolving Jinja2 whitespace issues, working with uvicorn import, utilizing openapi.json client code generation for documentation purposes, adding metadata to enhance docs, and sharing locks across multiple processes. Additionally, it provides useful resources for advanced usage.
Published

April 2, 2023


enable render option trim_blocks and lstrip_blocks with jinja2 to avoid whitespace and indentation nightmare.


always remember to import uvicorn if you want to run without the uvicorn executable


generate nodejs client from openapi.json

fastapi-code-generator to generate python code


create doc inside code: adding metadata


to share lock across process, use redis lock or filelock.

to share lock across forked process in the same worker, use multiprocessing.Lock()


fastapi can generate openapi json and doc page

websockets are async. will it block the server?

using websocket in fastapi

celery advance usage

celery and fastapi

happen to found akismet (proprietary wordpress spam protection). oss alternatives are: