Repository navigation
Implement Server.start_serving() and related APIs - #224
Conversation
Thank you! Sorry for the late review, I was OOO for about 10 days. I'll try to address all your questions below:
OK.
Sure. If necessary we can always add an assertion at a lower level for clarity.
Usually we try to match (exactly)
It is a user-facing API: the object is returned from the Things that have the
Yes, there can be many. If you create a server on In asyncio implementation (see
The
I think we should be able to copy/paste asyncio implementation from |
fa7830c to
f3076b0
Compare
AFAICT, cpython only wraps .. but not when calling
OK sorry for the noise, I missed the
Indeed, I did just that. |
57c0d6d to
0be8002
Compare
|
I had another look at "why are the OSError messages different", and it looks like the reason is:
The libuv docs for
This is very different from plain asyncio, which bombs as soon as it attempts |
|
Oh well... I guess the only sure option we have is to rewrite this part: Lines 1658 to 1696 in d8fe153 to create Python sockets and bind them in the same way asyncio does that here: After we have Python sockets bound, we can wrap them in Lines 1708 to 1713 in d8fe153 That's the only way I can think of that will preserve full compatibility with asyncio. Performance-wise this shouldn't have any impact. |
|
OK sounds like a plan! |
|
@1st1 I have implemented what you suggested, but I'm now getting a warning about an unclosed resource: What do we need to do with the Python socket object once we have wrapped it in a Edit: the problem was in fact due to |
6900ae5 to
045dcd4
Compare
045dcd4 to
321abf2
Compare
321abf2 to
5dddc70
Compare
5dddc70 to
d88973d
Compare
d88973d to
717cb77
Compare
|
Hi Yury, what's the commit policy for uvloop, specifically who is expected to actually do the merge to master? The reviewer, author, .. ? |
|
You can merge it yourself. Please rebase it on top of recent master before merging though (has now flake8 integration) |
717cb77 to
8fac545
Compare
|
OK I've rebased on top of master and fixed 2 flake8 errors. If CI completes successfully I'll merge it. |
|
When a new release with these changes will be published? |
|
Need to implement sendfile support first. |
|
Any estimates for that? |
|
Unfortunately I don't have time to tackle that myself in the next couple of weeks. Hopefully we'll get it in March. |
|
Thanks so much, @jlaine! |
This is still work in progress, but I wanted to have some code up so we can start discussing it.
I have moved
backlogto a member, so thatlisten(internal API forstart_serving) can be called without arguments.I noticed some argument validation (e.g.: backlog, ssl, ssl_backlog, timeouts) is performed quite deep inside the code, inside
UVStreamServer. Shouldn't this be done closer to the API surface?Currently one test fails because the previous code caught an
OSErrorand re-raised it with a different message. Is this a behaviour we want to preserve?I'm having trouble understanding the
Serverclass, which seem to serve as the user-facing API as opposed to the internalUVStreamServersubclasses. The bit that bothers we: why doesServerhave a list of servers, can there really be anything other than 0 or 1?Who should carry the internal
is_servingstate, theServeror theUVStreamServer?How should we implement the future returned by
serve_forever?