curl-library
Re: pycurl update for multi interface
Date: Wed, 9 Oct 2013 09:49:39 -0700
I'm sure someone will find use for penalty values.
I don't think it's easy to use them right:
only get requests are pipelined, server "decides" on download and
especially chunk length, then the client is probably interested in how
long the transfer is going to take rather than bytes transferred, so
client needs to keep track of download speed and vary the penalty size
according to current network conditions.
seems a bit complicated, does it not?
I on the other hand am more concerned in making sure only N sockets
are used at most any given time and max total up/down bandwidth used
across multi handles. requests can wait, additional latency can be
ignored.
perhaps the two use cases are clearer now?
anyway, it costs little to expose these settings, thus we should.
while on the subject, should pycurl provide an easy/sample loop around
perform()/fdset()/select()/info_read() calls? for those of us who just
want to load a bunch of requests into a multi object and get the
results?
an api could be smth like
completed_handles = multi_handle.perform(timeout=None)
# block up to timeout seconds (float) or until some request returns
(well or badly)
# return [] immediately or wait or even raise an exception if
multi_handle is empty (?)
On 8 October 2013 14:04, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Tue, 8 Oct 2013, Dima Tisnek wrote:
>
>> options like *_PENALTY_SIZE are "magic" in a sense that using these
>> doesn't encourage good APIs.
>
>
> How so?
>
> Those options were added based on real-world HTTP pipelining experiences. I
> don't see how they make the API worse or better in any way.
>
>
>> they are still safe to export in hopes that someone finds a good, sensible
>> use.
>
>
> What's an insensible use of them?
>
>
>> some easy options on the other hand may be just too hard to implement
>> correctly/nicely, e.g. SSL_CTX_*, error buffer, file object magic. that is
>> these features should be exported, but only in some reasonable python
>> bindings rather than directly.
>
>
> True, you may need to wrap a bunch of options in necessary language specific
> magic. Like how all the callback options need to be handled to make sense
> for example.
>
>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-10-09