Repository navigation
Conversation
| ], | ||
| install_requires=[ | ||
| 'h11 ~= 0.8.1', # means: 0.8.x where x >= 1 | ||
| 'h2 >= 3.1.0', |
There was a problem hiding this comment.
Should we have an upper bound here?
There was a problem hiding this comment.
We could do 'h2 ~= 3.1'?
There was a problem hiding this comment.
I never really know/remember what ~= means.
I think h2 is a proper good semver citizen and we can use >=3.1,<4.
There was a problem hiding this comment.
>=3.1,<4 is the same as ~=3.1 as I understand it.
|
|
||
| from .connection import ConnectionType | ||
| from .handshake import H11Handshake | ||
| from .handshake import H2Handshake, H11Handshake |
There was a problem hiding this comment.
double space after import - or is this added by black/linting?
There was a problem hiding this comment.
No, just a mistake. Interesting that nothing fixed it...
| if http_version is HTTPVersion.H11: | ||
| self.handshake = H11Handshake(connection_type) | ||
| else: | ||
| self.handshake = H2Handshake(connection_type) |
There was a problem hiding this comment.
How about directly passing in a Handshake object instead of adding another enum?
Assuming we could pass in conn = WSConnection(... handshake=None), this would give us a nice way to disable handshakes and directly get a "ready-to-exchange-WS-frames" WSConnection object. Thoughts?
There was a problem hiding this comment.
I'm happy to pass a handshake_class rather than the enum, but I think the handshake=None won't work as you hope, however the Connection class itself is exactly a "ready-to-exchange-WS-frames" object. The reason is that the Connection object must know what extensions to use on initialization.
There was a problem hiding this comment.
Right, I remember we already talked about it.
Please add a good doc-string that explains the two different use cases - then I'm happy with it.
| yield CloseConnection(code=exc.code, reason=str(exc)) | ||
|
|
||
|
|
||
| class H2Wrapper(object): |
There was a problem hiding this comment.
I'm not sure if anyone is actually going to use this wrapper in production.
Maybe this would be better moved to an example script?
There was a problem hiding this comment.
I agree with you, I'll move
There was a problem hiding this comment.
Sorry I'm wrong, this is required if you use the H2Handshake.
There was a problem hiding this comment.
Maybe move it into the H2Handshake then?
I have no strong opinion either way.
(Please don't merge)
This is a work in progress, but is presented here for comments.