[Twisted-Python] Foolscap-0.0.5 released (aka newpb)

kgi iacovou at gmail.com
Wed Nov 8 12:53:37 EST 2006


I'm trying to use Foolscap as a component in a system where it has to work 
with a lot of data that gets passed back from XML-RPC services.

So far it's been a pleasant experience: it's much more accessible 
than 'oldpb', the intro was easy to read and follow, and it looks and feels 
well-written: thank you!

XML-RPC was chosen in the interests of 'extreme interoperability', but there 
are small parts of the system where the data rate is somewhat too great: for 
these, XML-RPC is utterly unsuited, but Foolscap seems to be a good choice.

As a side-effect of this XML-RPC dependency, I needed to be able to pass 
xmlrpclib.DateTime objects over PB. The documentation states the following:

  "Note that you can also register an ICopyable adapter on third-party classes
   to avoid subclassing."

I spent a while trying to get this working by writing adapation classes and 
whatnot. I got the send part working but couldn't convince the receiver to 
recognise and deserialise the class. Then I looked through the source and 
test code and realised that you've provided an easier interface to do it, but 
haven't mentioned this in the documentation.

Given that being able to send third-party classes over Foolscap is probably a 
very common requirement, I thought I'd send a simple example for others in 
the same position lest they be led into thinking that this requires 
subclassing or writing adaptation classes.

You could even insert these in the part of the documenation about copyables 
where it says "TODO: example" :-)



-------------- next part --------------
A non-text attachment was scrubbed...
Name: DateClient.py
Type: application/x-python
Size: 807 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20061108/0155f12a/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DateCopy.py
Type: application/x-python
Size: 428 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20061108/0155f12a/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DateService.py
Type: application/x-python
Size: 548 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20061108/0155f12a/attachment-0002.bin 

More information about the Twisted-Python mailing list