ASGI – async / await • Starlette – an ASGI implemented on top of uvicorn
• async background tasks without Celery – no blocking import time @api.route("/incoming") async def receive_incoming(req, resp): @api.background.task def process_data(data): """Just sleeps for three seconds, as a demo.""" time.sleep(3) # Parse the incoming data as form-encoded. # Note: 'json' and 'yaml' formats are also automatically supported. data = await req.media() # Process the data (in the background). process_data(data) # Immediately respond that upload was successful. resp.media = {'success': True}
How to start? • https://github.com/metakermit/responder-react
• A simple Responder backend & React frontend starter kit
• Using https://parceljs.org/ – a fast, 0-config web app bundler pip install -U cookiecutter cookiecutter gh:metakermit/responder-react cd helloresponderreact # local environment bin/install bin/start # docker environment docker-compose up