want to see this document” ◦ “Here is my username and password” • Servers reply with HTTP Responses ◦ “Here’s that document” ◦ “I couldn’t find that document” ◦ “Look over here for that document” • Semantics defined in RFC 7231
for doing multiple things at a time. • Basically jump between a set of “tasks” when those tasks are doing something that doesn’t require CPU (blocking I/O, disk, networking) TASK A * CPU work* TASK B sleep(10)
/ sync don’t cooperate well together. • If any sync-blocking I/O, will hold up all other tasks • If async, can’t be executed from sync context • Typically library authors pick one or the other → Fragmentation
HTTP client interface • Leverages urllib3 for HTTP dispatch • Extensible via custom Adapters • De-facto standard for HTTP in Python • Synchronous, HTTP/1.1 only
synchronous I/O only • Support HTTP/1.X only • HTTP implementation tightly-coupled to the standard library • Missing 8+ years of innovations to HTTP and async I/O
state-machines • Written by Cory Benfield, Brett Cannon, and others • Many benefits to this design: testable, reusable. • No coupling to I/O, allows sync and async
2015 by Cory Benfield ◦ HTTP/2 implementation in sans-I/O Python ◦ Pulled out of the hyper package into their own packages • h11 ◦ Released in 2016 by Nathaniel Smith ◦ HTTP/1.1 implementation in sans-I/O Python
by Tom Christie • Supports HTTP/1.1, HTTP/2, (HTTP/3 planned) • Requests-like interface • Allows making synchronous and async requests • Supports Asyncio and Trio • (I’m a maintainer of this library)
Everyone benefits from well-maintained sans-I/O protocol libraries • All libraries mentioned here are Open Source and would benefit from your contributions • There’s still plenty of work to do!