I am new to Python. Just want to know is there any module in python similar to ruby's drb? Like a client can use object provided by the drb server?
-
3If you want to widen the audience who can answer your question you can describe what Distributed Ruby (aka drb) does. Because I'm pretty strictly a Python guy and I have no idea. – Omnifarious Oct 28 '09 at 07:02
-
1"Distributed Ruby is a distributed object system for Ruby. It allows an object in one Ruby process to invoke methods on an object in another Ruby process on the same or a different machine. " Bacially, a drb server acts as a source of objects. To the client, it appears that the objects are local, but the code is executed remotely on the server side. – ccy Oct 28 '09 at 08:15
-
You can edit your original question, better put the description there. – nikow Oct 28 '09 at 11:08
6 Answers
Pyro does what I think you're discribing (although I've not used drb).
From the website:
Pyro is short for PYthon Remote Objects. It is an advanced and powerful Distributed Object Technology system written entirely in Python, that is designed to be very easy to use. Never worry about writing network communication code again, when using Pyro you just write your Python objects like you would normally. With only a few lines of extra code, Pyro takes care of the network communication between your objects once you split them over different machines on the network. All the gory socket programming details are taken care of, you just call a method on a remote object as if it were a local object!

- 9,101
- 4
- 34
- 52
-
It is, but given you posted first and managed to provide a list of alternatives as well I'll not begrudge your answer having received more votes! – mavnn Oct 28 '09 at 10:42
I have no idea what drb is, but from the little information you have given, it might be something like the Perspective Broker in Twisted
Introduction
Suppose you find yourself in control of both ends of the wire: you have two programs that need to talk to each other, and you get to use any protocol you want. If you can think of your problem in terms of objects that need to make method calls on each other, then chances are good that you can use twisted's Perspective Broker protocol rather than trying to shoehorn your needs into something like HTTP, or implementing yet another RPC mechanism.
The Perspective Broker system (abbreviated PB, spawning numerous sandwich-related puns) is based upon a few central concepts:
serialization: taking fairly arbitrary objects and types, turning them into a chunk of bytes, sending them over a wire, then reconstituting them on the other end. By keeping careful track of object ids, the serialized objects can contain references to other objects and the remote copy will still be useful.
remote method calls: doing something to a local object and causing a method to get run on a distant one. The local object is called a RemoteReference, and you do something by running its .callRemote method.

- 26,247
- 4
- 39
- 46