summaryrefslogtreecommitdiff
path: root/wiki/dev/stop-building-synchronous-web-containers.md
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2020-01-28 20:49:17 -0500
committerOwen Jacobson <owen@grimoire.ca>2020-01-28 23:23:18 -0500
commit0d6f58c54a7af6c8b4e6cd98663eb36ec4e3accc (patch)
treea2af4dc93f09a920b0ca375c1adde6d8f64eb6be /wiki/dev/stop-building-synchronous-web-containers.md
parentacf6f5d3bfa748e2f8810ab0fe807f82efcf3eb6 (diff)
Editorial pass & migration to mkdocs.
There's a lot in grimoire.ca that I either no longer stand behind or feel pretty weird about having out there.
Diffstat (limited to 'wiki/dev/stop-building-synchronous-web-containers.md')
-rw-r--r--wiki/dev/stop-building-synchronous-web-containers.md41
1 files changed, 0 insertions, 41 deletions
diff --git a/wiki/dev/stop-building-synchronous-web-containers.md b/wiki/dev/stop-building-synchronous-web-containers.md
deleted file mode 100644
index 320b3f7..0000000
--- a/wiki/dev/stop-building-synchronous-web-containers.md
+++ /dev/null
@@ -1,41 +0,0 @@
-# Stop Building Synchronous Web Containers
-
-Seriously, stop it. It's surreally difficult to build a sane ansynchronous service on top of a synchronous API, but building a synchronous service on top of an asynchronous API is easy.
-
-* WSGI: container calls the application as a function, and uses the return
- value for the response body. Asynchronous apps generally use a non-WSGI
- base (see for example [Bottle](http://bottlepy.org/docs/dev/async.html)).
-
-* Rack: container calls the application as a method, and uses the return
- value for the complete response. Asynchronous apps generally use a non-Rack
- base (see [this Github ticket](https://github.com/rkh/async-rack/issues/5)).
-
-* Java Servlets: container calls the application as a method, passing a
- callback-bearing object as a parameter. The container commits and closes
- the response as soon as the application method returns. Asynchronous apps
- can use a standard API that operates by _re-invoking_ the servlet method as
- needed.
-
-* What does .Net do?
-
-vs
-
-* ExpressJS: container calls the application as a function, passing a
- callback-bearing object as a parameter. The application is responsible for
- indicating that the response is complete.
-
-## Synchronous web containers are bad API design
-
-* Make the easy parts easy (this works)
-
-* Make the hard parts possible (OH SHIT)
-
-## Writing synchronous adapters for async APIs is easy
-
- def adapter(request, response_callback):
- synchronous_response = synchronous_entry_point(request)
- return response_callback(synchronous_response)
-
-Going the other way is more or less impossible, which is why websocket
-support, HTML5 server-sent event support, and every other async tool for the
-web has an awful server interface.