Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #85611
| From | Marko Rauhamaa <marko@pacujo.net> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Async/Concurrent HTTP Requests |
| Date | 2015-02-12 21:37 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <87fvaavs4a.fsf@elektro.pacujo.net> (permalink) |
| References | <7a6ca7b9-ad3a-4361-88fc-580e41452874@googlegroups.com> <87y4o3f13a.fsf@jester.gateway.pace.com> <87k2znufhw.fsf@elektro.pacujo.net> <87twyrez5d.fsf@jester.gateway.pace.com> |
Paul Rubin <no.email@nospam.invalid>:
> Marko Rauhamaa <marko@pacujo.net> writes:
>> I have successfully done event-driven I/O using select.epoll() and
>> socket.socket().
>
> Sure, but then you end up writing a lot of low-level machinery that
> packages like twisted take care of for you.
Certainly. It would be nice if the stdlib protocol facilities were
event-driven and divorced from the low-level I/O.
Asyncio does that, of course, but the programming model feels a bit
weird.
Twisted documentation seems a bit vague on details. For example, what
should one make of this:
def write(data):
Write some data to the physical connection, in sequence, in a
non-blocking fashion.
If possible, make sure that it is all written. No data will ever
be lost, although (obviously) the connection may be closed before
it all gets through.
<URL: https://twistedmatrix.com/documents/15.0.0/api/twisted.intern
et.interfaces.ITransport.html#write>
So I'm left wondering if the call will block and if not, how is flow
control and buffering managed. The API documentation leads me to a maze
of twisted passages, all alike. From what I could gather, the write()
method is blocking and hence not suitable for serious work.
By contrast, the semantics of Python's socket.send() is crisply defined
and a pleasure to work with.
Marko
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Async/Concurrent HTTP Requests Ari King <ari.brandeis.king@gmail.com> - 2015-02-12 08:37 -0800
Re: Async/Concurrent HTTP Requests Zachary Ware <zachary.ware+pylist@gmail.com> - 2015-02-12 11:59 -0600
Re: Async/Concurrent HTTP Requests Paul Rubin <no.email@nospam.invalid> - 2015-02-12 10:15 -0800
Re: Async/Concurrent HTTP Requests Marko Rauhamaa <marko@pacujo.net> - 2015-02-12 20:55 +0200
Re: Async/Concurrent HTTP Requests Paul Rubin <no.email@nospam.invalid> - 2015-02-12 10:57 -0800
Re: Async/Concurrent HTTP Requests Marko Rauhamaa <marko@pacujo.net> - 2015-02-12 21:37 +0200
csiph-web