[Twisted-Python] Please recommend a RPC system working with twisted.
![](https://secure.gravatar.com/avatar/58e37c9d477659b047876e02076ceabf.jpg?s=120&d=mm&r=g)
Hi all, I'm looking for an RPC system working with twisted. 1. Binary. I want it run faster than any xml based RPC. 2. Bidirectional. Unlike HTTP, on which the client has to poll the sever for events, the server should "call" the client's method to notify events. 3. C/Python support. Part of the system shall be written in C. 4. Could easily integrated with twisted. Unfortunately, there seems no such resolution existed. So maybe I have to give up some requirements.
![](https://secure.gravatar.com/avatar/52cff2b66b9e291797f15f0c1b3491b8.jpg?s=120&d=mm&r=g)
On 2008.07.21 15:01:49 +0800, Peter Cai wrote:
Twisted AMP meets all your requirements except C support, which you could probably add. (Or maybe avoid adding by using some other way to bridge C computing code with Python network code, like ctypes.) Also take a look at Google's Protocol Buffers, which lacks C support but has C++ support. A Twisted version called txprotobuf was recently announced. (Note that Protocol Buffers isn't really a full RPC system, just the serialization part.) I think combining these two might work nicely, though I haven't tried it yet. -- David Ripton dripton@ripton.net
![](https://secure.gravatar.com/avatar/58e37c9d477659b047876e02076ceabf.jpg?s=120&d=mm&r=g)
Thanks. I've done some research but seems that AMP does not have any C or CPP implementation. As described in this thread, the python implementation of Google Buffer is not very mature, that's why I have gave it up. https://groups.google.com/group/protobuf/browse_thread/thread/9acb7638e1f5ff61/2fc640fd1d3f98b8?lnk=gst&q=python I think I shall try to make ICE work with twisted, although thread synchronization might be a problem. BTW : If you are interested in RPC, have a look at http://zeroc.com/ice.html On Mon, Jul 21, 2008 at 9:18 PM, David Ripton <dripton@ripton.net> wrote:
-- 当只有一张纸和一支笔的时候, 我相信你写下的东西对你来说就是真实的, 不管他们到底是不是真的。
![](https://secure.gravatar.com/avatar/d6328babd9f9a98ecc905e1ccac2495e.jpg?s=120&d=mm&r=g)
On 02:16 am, newptcai@gmail.com wrote:
I've done some research but seems that AMP does not have any C or CPP implementation.
I think I shall try to make ICE work with twisted, although thread synchronization might be a problem.
In my humble opinion, implementing AMP in C would be a lot easier than dealing with thread synchronization issues. The benefits of Twisted will evaporate pretty quickly once you are in that territory. If I had more than 30 seconds to write this reply, I'd probably write it myself to prove the point ;).
![](https://secure.gravatar.com/avatar/5520a5b945233739dda3299b70d13f0b.jpg?s=120&d=mm&r=g)
On Mon, Jul 21, 2008 at 3:18 PM, David Ripton <dripton@ripton.net> wrote:
Hi, I recently added a C++ RPC implementation using boost.asio, in txprotobuf-asio branches. You can check it out there: http://bazaar.launchpad.net/~proppy/txprotobuf/asio/files bzr branch lp:~proppy/txprotobuf/asio Hope that helps. -- bou ^
![](https://secure.gravatar.com/avatar/3a7e70f3ef2ad1539da42afc85c8d09d.jpg?s=120&d=mm&r=g)
On Mon, Jul 21, 2008 at 3:01 AM, Peter Cai <newptcai@gmail.com> wrote:
twisted.protocols.amp looks like the closest thing: it's a very simple, efficient protocol for remote procedure calls. I can't point you directly at a C implementation, but I think there may be a C++ implementation somewhere. In any case, it would be pretty simple to implement. -- Christopher Armstrong International Man of Twistery http://radix.twistedmatrix.com/ http://twistedmatrix.com/ http://canonical.com/
![](https://secure.gravatar.com/avatar/52cff2b66b9e291797f15f0c1b3491b8.jpg?s=120&d=mm&r=g)
On 2008.07.21 15:01:49 +0800, Peter Cai wrote:
Twisted AMP meets all your requirements except C support, which you could probably add. (Or maybe avoid adding by using some other way to bridge C computing code with Python network code, like ctypes.) Also take a look at Google's Protocol Buffers, which lacks C support but has C++ support. A Twisted version called txprotobuf was recently announced. (Note that Protocol Buffers isn't really a full RPC system, just the serialization part.) I think combining these two might work nicely, though I haven't tried it yet. -- David Ripton dripton@ripton.net
![](https://secure.gravatar.com/avatar/58e37c9d477659b047876e02076ceabf.jpg?s=120&d=mm&r=g)
Thanks. I've done some research but seems that AMP does not have any C or CPP implementation. As described in this thread, the python implementation of Google Buffer is not very mature, that's why I have gave it up. https://groups.google.com/group/protobuf/browse_thread/thread/9acb7638e1f5ff61/2fc640fd1d3f98b8?lnk=gst&q=python I think I shall try to make ICE work with twisted, although thread synchronization might be a problem. BTW : If you are interested in RPC, have a look at http://zeroc.com/ice.html On Mon, Jul 21, 2008 at 9:18 PM, David Ripton <dripton@ripton.net> wrote:
-- 当只有一张纸和一支笔的时候, 我相信你写下的东西对你来说就是真实的, 不管他们到底是不是真的。
![](https://secure.gravatar.com/avatar/d6328babd9f9a98ecc905e1ccac2495e.jpg?s=120&d=mm&r=g)
On 02:16 am, newptcai@gmail.com wrote:
I've done some research but seems that AMP does not have any C or CPP implementation.
I think I shall try to make ICE work with twisted, although thread synchronization might be a problem.
In my humble opinion, implementing AMP in C would be a lot easier than dealing with thread synchronization issues. The benefits of Twisted will evaporate pretty quickly once you are in that territory. If I had more than 30 seconds to write this reply, I'd probably write it myself to prove the point ;).
![](https://secure.gravatar.com/avatar/5520a5b945233739dda3299b70d13f0b.jpg?s=120&d=mm&r=g)
On Mon, Jul 21, 2008 at 3:18 PM, David Ripton <dripton@ripton.net> wrote:
Hi, I recently added a C++ RPC implementation using boost.asio, in txprotobuf-asio branches. You can check it out there: http://bazaar.launchpad.net/~proppy/txprotobuf/asio/files bzr branch lp:~proppy/txprotobuf/asio Hope that helps. -- bou ^
![](https://secure.gravatar.com/avatar/3a7e70f3ef2ad1539da42afc85c8d09d.jpg?s=120&d=mm&r=g)
On Mon, Jul 21, 2008 at 3:01 AM, Peter Cai <newptcai@gmail.com> wrote:
twisted.protocols.amp looks like the closest thing: it's a very simple, efficient protocol for remote procedure calls. I can't point you directly at a C implementation, but I think there may be a C++ implementation somewhere. In any case, it would be pretty simple to implement. -- Christopher Armstrong International Man of Twistery http://radix.twistedmatrix.com/ http://twistedmatrix.com/ http://canonical.com/
participants (5)
-
Christopher Armstrong
-
David Ripton
-
glyph@divmod.com
-
Johan Euphrosine
-
Peter Cai