[Twisted-Python] Compressing PB communication

Jean-Paul Calderone exarkun at divmod.com
Wed Jun 28 17:00:29 MDT 2006


On Thu, 29 Jun 2006 00:42:41 +0300, Tzahi Fadida <tzahi.ml at gmail.com> wrote:
>
>I am interested in compressing the PB objects after serialization and
>unpacking when received at the other side.
>I a using the pb.PBClientFactory() and ServerFactory from the documentation.
>Where is the most proper place to hack this?
>What is possible?
>I need to do this after the object becomes a string so i won't have to pickle
>a string.
>Is it possible to do something like factory.protocol.serialize=mySerialize
>and in mySerialize i use the banana.encode function to encode the list of
>jelly myself and return there a new list that contains the now ziped and
>encoded value and let it go as it were.
>This way i am not interfering with the jelly logic.
>

Attached a demonstration of doing this.

However, I doubt it's actually a useful idea.

Jean-Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zip.py
Type: text/x-python
Size: 2019 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20060628/dc4cfb73/attachment-0002.py>


More information about the Twisted-Python mailing list