Message217080
> 1) I really don't like the use_fallback argument
> Apart from complicating the prototype, what do this bring?
My initial thought was that the user might want to know *why* a file cannot be sent by using the fastest method and hence wants to see the original exception. Anyway, I have not strong opinions about this so I guess we can also drop it.
> A useful parameter instead would be to support sending only part of the file,
> so adding a count argument.
Have you read my patch? This is already provided by the "offset" parameter.
> I really don't like the blocksize argument.
> I've *never* seen code which explicitly uses a blocksize
Both sendfile() and TransmitFile provide a "blocksize" parameter for very good reasons therefore it seems natural that an API built on top of them exposes the same parameter as well.
Some examples in the stdlib which comes to mind using a blocksize are asynchat.async_chat.ac_out_buffer_size and ftplib.FTP.storbinary and I'm sure if you grep for "blocksize" you'll find others.
Providing a blocksize is also necessary to tell how many bytes to read from file in case send() is used, 'cause it's *crucial* that you don't read the whole file into memory.
I will also give a real world example: if your app wants to limit the transfer speed you will want to explicitly transmit smaller chunks of data and then "sleep", and the only way to do that is by manipulating the blocksize. So yes: a blocksize parameter *is* necessary, so please stop beating that horse.
As for using a bigger value: I made some benchmarks by using different sizes and I didn't notice any noticeable difference. |
|
Date |
User |
Action |
Args |
2014-04-23 17:26:38 | giampaolo.rodola | set | recipients:
+ giampaolo.rodola, pitrou, christian.heimes, josiah.carlson, asvetlov, neologix, akira, rosslagerwall, josh.r |
2014-04-23 17:26:38 | giampaolo.rodola | set | messageid: <1398273998.89.0.0627946596294.issue17552@psf.upfronthosting.co.za> |
2014-04-23 17:26:38 | giampaolo.rodola | link | issue17552 messages |
2014-04-23 17:26:38 | giampaolo.rodola | create | |
|