Message291282
In certain protocols modify() is supposed to be used on every interaction between client and server. E.g. an FTP server does this:
- register(fd, EVENT_READ); recv() # wait command from client
- modify(fd, EVENT_WRITE); send(response) # send response
- modify(fd, EVENT_READ); recv() # wait for new command
...so it's two calls for each command received.
In asyncio modify() is also used in different circumstances.
If you're worried about code duplication I can refactor selectors.py first, but IMO it would be a bad idea to reject this or future improvements because the current code status prevents code reuse. Right now there are already 3 classes sharing basically the same code (poll, epoll and devpoll related classes). Those can be refactored similarly to this:
https://github.com/giampaolo/pyftpdlib/blob/ab699b5f89223e03593f3e004d6a370b4c2e5308/pyftpdlib/ioloop.py#L465-L565 |
|
Date |
User |
Action |
Args |
2017-04-07 18:09:29 | giampaolo.rodola | set | recipients:
+ giampaolo.rodola, vstinner, neologix, yselivanov |
2017-04-07 18:09:29 | giampaolo.rodola | set | messageid: <1491588569.64.0.737380369627.issue30014@psf.upfronthosting.co.za> |
2017-04-07 18:09:29 | giampaolo.rodola | link | issue30014 messages |
2017-04-07 18:09:29 | giampaolo.rodola | create | |
|