Fastapi, Celery, Task Queue, Websocket
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.
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?
happen to found akismet (proprietary wordpress spam protection). oss alternatives are:
forget spam comment (js plugin for wordpress)