Comments (3)
Yeah, it's possible we'll want to make different decisions in a lower-level API. I'm not 100% sure it will make sense though. A low-level API doesn't have to be as comfortable to use or support retries, so those downsides don't apply. But we'd still need to figure out how to deal with the state complexity, and need some special-case mechanism to avoid aborting the request body when we get an early response.
We'll also need to double-check what grpc actually needs before committing to anything... my clever idea to make bidi HTTP look like an Upgrade/CONNECT is clever and all, but it still assumes that bidi HTTP users are OK with waiting for the response headers before they switch into bidi mode, and I'm actually not 100% sure whether that's true of grpc or not. (@standy66, do you know?)
Also, grpc only cares about bidi support over HTTP/2, and with HTTP/2 we don't need to abort the response body on early responses, so that whole issue goes away...
from hip.
I'm in complete agreement with the conclusion.
I wonder if there's a way we could include a push-based approach for a lower-level API, something that we've talked about a couple times about two layers of API: one that's basically ahip.request(...)
(and all config objects like ahip.Retries()
) for the 95% use-case and another for basically if grpc or the like want to use Hip. That's a far-future feature though.
from hip.
The way I thought about this was like how websockets are usually implemented. You write stuff to the request, read responses then. If you want to alternate between the two (extreme case: multipart request and response), you can. The server responding early is not a problem as I see it. If the user doesn't stop sending data after an early response, we can raise an exception when they try to send more.
As this implies, I strongly favor push-style over pull-style.
from hip.
Related Issues (20)
- When should we run unasync? HOT 3
- Overall plans for the project HOT 9
- Test the Proactor event loop on Windows + Python 3.8 HOT 1
- Repo cleanup HOT 6
- More cleanups HOT 2
- Discussion: What do we call the async versions of hip.get, hip.post, etc.? HOT 24
- What should we do with urllib3's securetransport and pyopenssl support? HOT 1
- Early data support HOT 4
- Intermittent failures HOT 3
- Stop worrying about backwards-compatibility HOT 1
- support for request targets that can't be specified as URLs
- First steps towards a high-level HTTP client API
- Running unasync on test files HOT 8
- Tracking issue: intermittent test failures
- How to handle Response bodies?
- Improve documentation UX for sync and async APIs HOT 2
- Add support for Async and Sync Iterators as Request bodies
- ahip, hip, async tests and coverage HOT 3
- PoolManager(block=True) + trio.nursery causes EmptyPoolError HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hip.