[Twisted-Python] is there way to baypass value limit of 64kb in twisted.protocols.amp
glyph at twistedmatrix.com
Mon Nov 30 14:23:48 EST 2009
On Nov 30, 2009, at 2:10 PM, MārisR wrote:
> I'm currently trying to figure out, how to bypass amp value limit of 64kb. First tought was to split string into chunks <64kb, then join before processing. Problem is, how to dinamicaly generate amp.Command argument list. Maybe there is other well known method how to achieve this?
You can define your own Argument which reads multiple values, rather than dynamically generating the arguments list. This is what you want anyway, because your application code wants to receive one value; the fact that you are splitting/joining at the protocol level should not be important.
There's an example of this implemented here:
The reason that this isn't currently included in the core AMP implementation is that if you need to transfer values larger than this limit, perhaps you should be doing the transfer in some other way. Streaming the result? Doing the transfer out-of-band as (for example) an HTTP request?
I think this might be an unhelpful way to ask people to consider this problem, so we may end up packaging something similar in Twisted eventually. One way to do this might be by doing this: <http://twistedmatrix.com/trac/ticket/2529>, another might be bundling the contents of mediumbox.py (or something like it) into amp.py.
More information about the Twisted-Python