[Twisted-Python] What rough protocol, its hour come at last, slouches towards Austin to be born?

Glyph Lefkowitz glyph at twistedmatrix.com
Mon Apr 8 18:08:37 EDT 2002

I just checked in a substantial refactoring and change to Jelly,
finalizing what I think Jelly ought to look like in PB's wire protocol. 
Before I declare that it is well and truly standard, however, there are
a few things I'd like to resolve, and I'd be interested to hear a few
opinions on them...

1: use of the word "tuple".

Jelly uses the word "tuple" on the wire, which is fairly
Python-specific.  Really it ought to be "immutable-list" or something
similar (perhaps leaving the door open for more immutable types in the
future?).  Thoughts on this, especially from implementors in other

2: jellying of arguments/kwargs

Arguments and keyword arguments to methods are currently serialized in
their native Python form; a tuple and a dict.  This is probably not the
most natural way to serialize args in other languages (especially those
so deficient as not to have keyword arguments).  A couple of possible
small improvements come to mind:

    * provide alternate forms of proto_message which alternatively do or
do not send arguments, keyword args, or either

    * call jelly on the tuple/dict, but decompose them such that the
argument format does not include the leading "tuple" or "dictionary"
string (to make life easier for PB authors who do not want to implement
Jelly initially)

    * jelly the tuple and the dict together in one pass (this is really
more like a bug, since objects referred to once as an arg and once as a
kw arg will be serialized twice...)

3: eliminate "cachemessage" somehow

This is really an eyesore, but I can't easily think how to get rid of
it.  Perhaps cache IDs could be component somehow, not just integers?

4: always assume exactly one reference

some work is probably wasted right now in maintaining distributed
reference counts; the peer really only cares whether the other side has
a reference or it doesn't.  The one place that this is a little weird is
the decache/uncache handshake.

I can't think of any other issues to address before we call it final. 

 |    <`'>    |  Glyph Lefkowitz: Travelling Sorcerer  |
 |   < _/ >   |  Lead Developer,  the Twisted project  |
 |  < ___/ >  |      http://www.twistedmatrix.com      |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: This is a digitally signed message part
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20020408/f67ce758/attachment.pgp 

More information about the Twisted-Python mailing list