TIL search: asgi

asgi Writing tests for the ASGI lifespan protocol with HTTPX - 2020-06-29

Uvicorn silently ignores exceptions that occur during startup against the ASGI lifespan protocol - see [starlette/issues/486](https://github.com/encode/starlette/issues/486).

You can disable this feature using the `lifespan="on"` parameter to `uvicorn.run()` - which Datasette now does as-of [16f592247a2a0e140ada487e9972645406dcae69](https://github.com/simonw/datasette/commit/16f592247a2a0e140ada487e9972645406dcae69)

This exposed a bug in `datasette-debug-asgi`: it...

zeit-now Running a Python ASGI app on Zeit Now v2 - 2020-04-19

...It turns out you can subvert that model entirely and route all of your traffic through a single function - great for serving up Python WSGI or ASGI apps that handle traffic routing themselves.

the trick is to use the `"routes"` key in a `now.json` file like this:

    "version": 2,
    "builds": [
            "src": "json_head.py",
            "use": "@now/python"

cloudrun Use labels on Cloud Run services for a billing breakdown - 2020-04-21

...I applied this to all of my services by runnning this command:

gcloud run services list --platform=managed | tail -n +2
+  asgi-log-demo                  us-central1  https://asgi-log-demo-j7hipcg4aq-uc.a.run.app                  email@gmail.com                                           2020-04-22T00:40:39.483Z
+  cloud-run-hello                us-central1  https://cloud-run-hello-j7hipcg4aq-uc.a.run.app                email@gmail...

sqlite Using LD_PRELOAD to run any version of SQLite with Python - 2020-06-17

...Uvicorn running on (Press CTRL+C to quit)

And now reports the following:

    "python": {
        "version": "3.8.2",
        "full": "3.8.2 (default, Apr 27 2020, 15:53:34) \n[GCC 9.3.0]"
    "datasette": {
        "version": "0.44"
    "asgi": "3.0",
    "uvicorn": "0.11.5",