> On Dec 12, 2025, at 3:56 AM, Kirill Miazine <[email protected]> wrote:
>
> Hi, list
>
> The 65535 bytes limit on AMP values is a bit limiting sometimes. In my use
> case I have a fleet of command runners, which receive requests to execute
> some commands, execute commands and pass back commands' output. Especially
> when fetching web pages, output will often exceed the AMP value limit. Fow
> now I have been just cutting the output, but I'd like a better solution.
>
> A simple, but somewhat ugly, approach will be to split output in parts and
> send those as part1, [...], partN. It does not solve the issue fully, but
> with N big enough, the workaround should be aceptable.
>
> Is there an established pattern to use in such cases?
That's more or less the pattern. Usually if you need to send large values, you
also need to start taking backpressure, chunking, and multiplexing into
account, which is exactly what this somewhat arbitrary limit is meant to
encourage.
If you just need a higher limit for things that are on the order of 1-2
megabytes, where elaborate multiplexed streaming mechanisms are not worth
bothering with, you could look at an example like
https://www.evennia.com/docs/2.x/_modules/evennia/server/portal/amp.html . The
canonical example was originally at
https://code.launchpad.net/~glyph/+junk/amphacks but you can't view code on
launchpad any more.
If we were to improve AMP a bit, the length limit would be explicitly set,
rather than arbitrarily enforced by an implementation detail accident of the
protocol. I do want people to have to think about the length limit but
copy/pasting recipes like this and then forgetting it again is not really the
right way to encourage that.
-g
_______________________________________________
Twisted mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/twisted.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/ZUJOVGYIIYW25VYBOKITOYIFRJGCX6UW/
Code of Conduct: https://twisted.org/conduct