[Twisted-Python] Compressing PB communication

Tzahi Fadida Tzahi.ML at gmail.com
Thu Jun 29 17:34:18 EDT 2006


On Thursday 29 June 2006 22:31, Itamar Shtull-Trauring wrote:
> On Thu, 2006-06-29 at 22:01 +0300, Tzahi Fadida wrote:
> > I don't want to handle this on the application/PB level.
>
> twisted.spread.util.Pager and subclasses thereof will do it for you.
First, the objects themselves hold , for a example, a list of records.
The records themselves are probably never going to exceed 640kb.
Looking at banana it looks at the string types per field. I.e. even if the 
message is 1gb but each field in the message, like a list of strings 
[str1,str2,...] does not exceed 640kb then there is no problem, right?

Assumming there is a problem:
I don't see how using Pager, going to not involve circumventing a PB
call. This should be done under the level of performing a call to the other 
side. As i said, i cannot break the arbitrary objects i am sending since i 
cannot predict each and every one of them in advance.
The proper way to do it, looks to me in the underlying communication.
I think that what should have been done was to send the size of the transfer
in advance and only then say "ok, this transfer is going to be over 640kb
don't want it." Or " ok the transmission has exceeded 640kb => error"
And, according to this number and policy i enforce, limiting the size of the 
expanded message, pass a parameter to banana.
For now, i think that i will set the limit parameter for banana.py
pb.banana.SIZE_LIMIT=20*1024*1024 
however, for cBanana i will have to either hardwire it or change it to include
it as a parameter. This is not a variable in cBanana, it just says 640*1024
instead of SIZE_LIMIT.
How can i pass parameters to cBanana (at least at initialization time),
i am not sure if it is even on.
Though i am seeing it in the directory:
/usr/lib/python2.4/site-packages/twisted/spread/cBanana.so
Maybe there should be something like pb.changeMessageSizeLimit(numBytes)

>
>
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

-- 
Regards,
        Tzahi.
--
Tzahi Fadida
Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info
WARNING TO SPAMMERS:  see at 
http://members.lycos.co.uk/my2nis/spamwarning.html




More information about the Twisted-Python mailing list