[Twisted-Python] banana SIZE_LIMIT
![](https://secure.gravatar.com/avatar/2ab38a2d917d4c4cd62202177b72cec9.jpg?s=120&d=mm&r=g)
Hi, Are they some simple ways (keeping existing interface) around BananaError for long values returned from PB methods?
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
On Mar 18, 2013, at 7:49 AM, Sergey Gerasimov <sergun@gmail.com> wrote:
Hi,
Are they some simple ways (keeping existing interface) around BananaError for long values returned from PB methods?
Don't return long values. They block the connection. Chunk them up and stream them asynchronously by repeatedly calling a method to buffer them up, and then add a .finish() method that takes the buffered data and invokes your original logic. -glyph
![](https://secure.gravatar.com/avatar/607cfd4a5b41fe6c886c978128b9c03e.jpg?s=120&d=mm&r=g)
On 07:35 pm, glyph@twistedmatrix.com wrote:
On Mar 18, 2013, at 7:49 AM, Sergey Gerasimov <sergun@gmail.com> wrote:
Hi,
Are they some simple ways (keeping existing interface) around BananaError for long values returned from PB methods?
Don't return long values. They block the connection. Chunk them up and stream them asynchronously by repeatedly calling a method to buffer them up, and then add a .finish() method that takes the buffered data and invokes your original logic.
eg, using twisted.spread.util.Pager (or the StringPager or FilePager subclasses). Jean-Paul
-glyph
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (3)
-
exarkun@twistedmatrix.com
-
Glyph
-
Sergey Gerasimov