Message101944
> Hmm, indeed. What you can do, very simply, is cache the getvalue()
> result once you have generated it.
After some thoughts, it's not really an option: my cStringIO.StringIO buffer is, well a buffer. To append data to the buffer, I call buffer.write(). When I've got a chance to send data over the socket (remember, it's async, so I don't really know when it's going to happen), I call buffer.getvalue().
If socket.write() returns zero byte written, I'll have to wait until I get another chance to send my buffer. But in the meantime, some more data might get appended to the buffer, and the string returned by getvalue() will be different from the first call (and thus, I can't really cache it).
I could find some tricks (like using multiple buffers), but it would be ugly. |
|
Date |
User |
Action |
Args |
2010-03-30 16:43:21 | cbay | set | recipients:
+ cbay, janssen, pitrou, vstinner, giampaolo.rodola, r.david.murray |
2010-03-30 16:43:21 | cbay | set | messageid: <1269967401.36.0.387374361347.issue8240@psf.upfronthosting.co.za> |
2010-03-30 16:43:19 | cbay | link | issue8240 messages |
2010-03-30 16:43:19 | cbay | create | |
|