9 ms·
Can you please rewrite this in English?
by heavenlyblue 3y ago
Can you please rewrite this in English?
- westurner 3y agoIIRC the history of the async things in TLA in order: Twisted (callbacks), Eventlet (for Second Life by Linden Labs), tornado, gevent; gunicorn, Python 3.5+ asyncio [ tornado (FriendFeed, IPython Notebook (ZeroMQ (libzmq)),), Sanic (asyncio), fastapi, Django Channels (ASGI), ASGI: Asynchronous Server Gateway Interface, django-ninja, uvicorn (uvloop (libuv from nodejs)), ] The Async/await keywords were in F# (2007), then C# (2011), Haskell (2012), ... Python (2015), and JS/ES ECMAScript (2017) FWICS from the wikipedia article. When we talk about concurrency and parallelism, what are the different ~async patterns and language features? Processes, Threads, "Green Threads", 'generator coroutines' Necessarily, we attempt to define such terms but the implementations of the now more specifically-named software patterns have different interpretations of same, so what does Wikipedia have or teach on this is worth the time.
- westurner 3y agoUvicorn docs > Deployment > Gunicorn: https://www.uvicorn.org/deployment/#gunicorn https://www.uvicorn.org/deployment/#gunicorn : > The following will start Gunicorn with four worker processes: gunicorn -w 4 -k uvicorn.workers.UvicornWorker > The UvicornWorker implementation uses the uvloop and httptools implementations. PROMPT: Generate a minimal ASGI app and run it with Gunicorn+Uvicorn. What is uvloop? PROMPT: How does uvloop compare to libzmq and eBPF? Which asynchronous patterns do they support? PROMPT: Which Uvicorn (security) http headers work with which k8s Ingress pod YAML attributes and kubectl? PROMPT: (Generate an Ansible Role and Playbook to) Host an ASGI webapp with Kubernetes (k8s) Ingress maybe with ~k3d/microshift locally
- yencabulator 3y agoIf you want to write the history of Python async things in order, you'll need to put Twisted in many more of the places: it was callbacks only in the very beginning, then worked via generators, and once Python added async syntax used that. "Twisted (callbacks)" is a simplification that ignores the influence Twisted has had even on non-Python ecosystems; Deferreds have been imitated all over the place.
- westurner 3y agoBefore callbacks, there were function pointers and there was no Garbage Collection; And before function pointers, there were JMPs, trampolines, and labels in ASM. I don't share any reverence for the Twisted callback patterns that AJAX also implements. And, the article isn't about callbacks. Promises in JS have a separate success and error functions. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guid... MDN > Async function: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... : > The async function declaration creates a binding of a new async function to a given name. > The await keyword is permitted within the function body, enabling asynchronous, promise-based behavior to be written in a cleaner style and avoiding the need to explicitly configure promise chains