[Python-ideas] PEP 3156: Transport.sendfile
Nikolay Kim
fafhrd91 at gmail.com
Fri Jan 25 19:11:37 CET 2013
More information about the Python-ideas mailing list
Fri Jan 25 19:11:37 CET 2013
- Previous message: [Python-ideas] PEP 3156: Transport.sendfile
- Next message: [Python-ideas] PEP 3156: Transport.sendfile
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Jan 25, 2013, at 10:08 AM, Guido van Rossum <guido at python.org> wrote: > On Fri, Jan 25, 2013 at 10:03 AM, Nikolay Kim <fafhrd91 at gmail.com> wrote: > > I think Transport needs 'sendfile' api, something like: > > @tasks.coroutine > def sendfile(self, fd, offset, nbytes): > …. > > otherwise it is impossible to implement sendfile without breaking transport encapsulation > > Really? Can't the user write this themselves? What's wrong with this: > > while True: > data = os.read(fd, 16*1024) > if not data: break > transport.write(data) > > (Perhaps augmented with a way to respond to pause() requests.) > i mean 'os.sendfile()', zero-copy sendfile. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130125/acd685e9/attachment.html>
- Previous message: [Python-ideas] PEP 3156: Transport.sendfile
- Next message: [Python-ideas] PEP 3156: Transport.sendfile
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list