[Twisted-Python] combine local and remote calls in perspective brokers

Hello to all! I'm using PB as communication protocol for components of my system. Components can be located locally on the only one machine or in distributed fashion. It depends on the config file. At the moment all communications are implemented as callRemote calls. I would like to keep this unified way of communication but make inter-machine calls as efficient as possible. What is the best way to do that?

On Sun, Feb 24, 2013 at 11:23 AM, Sergey Gerasimov <sergun@gmail.com> wrote:
When you say "locally", is it still different processes talking to each other? Talking over TCP loopback on the same machine is pretty efficient, and unlikely to be a bottleneck, so you don't necessarily have to do anything special. -Itamar

From: Itamar Turner-Trauring [mailto:itamar@futurefoundries.com] Sent: Monday, February 25, 2013 4:38 AM To: sergun@gmail.com; Twisted general discussion Subject: Re: [Twisted-Python] combine local and remote calls in perspective brokers On Sun, Feb 24, 2013 at 11:23 AM, Sergey Gerasimov <sergun@gmail.com> wrote: Hello to all! I’m using PB as communication protocol for components of my system. Components can be located locally on the only one machine or in distributed fashion. It depends on the config file. At the moment all communications are implemented as callRemote calls. I would like to keep this unified way of communication but make inter-machine calls as efficient as possible. What is the best way to do that? When you say "locally", is it still different processes talking to each other? Talking over TCP loopback on the same machine is pretty efficient, and unlikely to be a bottleneck, so you don't necessarily have to do anything special. -Itamar Itamar, nn my case “locally” means local objects in the only one process.

Hi, It is fine to run both of sides within the same process, many test
suites in twisted do this.
I can be wrong, but tests often use `proto_helpers.StringTransport` to avoid spawning a new process and probably not intended for usage outside of tests. If it is the same process, why not to access objects directly? `pb.Referenceable` and `pb.Root` should be just wrappers around your own objects. -- Regards, Maxim

On Sun, Feb 24, 2013 at 11:23 AM, Sergey Gerasimov <sergun@gmail.com> wrote:
When you say "locally", is it still different processes talking to each other? Talking over TCP loopback on the same machine is pretty efficient, and unlikely to be a bottleneck, so you don't necessarily have to do anything special. -Itamar

From: Itamar Turner-Trauring [mailto:itamar@futurefoundries.com] Sent: Monday, February 25, 2013 4:38 AM To: sergun@gmail.com; Twisted general discussion Subject: Re: [Twisted-Python] combine local and remote calls in perspective brokers On Sun, Feb 24, 2013 at 11:23 AM, Sergey Gerasimov <sergun@gmail.com> wrote: Hello to all! I’m using PB as communication protocol for components of my system. Components can be located locally on the only one machine or in distributed fashion. It depends on the config file. At the moment all communications are implemented as callRemote calls. I would like to keep this unified way of communication but make inter-machine calls as efficient as possible. What is the best way to do that? When you say "locally", is it still different processes talking to each other? Talking over TCP loopback on the same machine is pretty efficient, and unlikely to be a bottleneck, so you don't necessarily have to do anything special. -Itamar Itamar, nn my case “locally” means local objects in the only one process.

Hi, It is fine to run both of sides within the same process, many test
suites in twisted do this.
I can be wrong, but tests often use `proto_helpers.StringTransport` to avoid spawning a new process and probably not intended for usage outside of tests. If it is the same process, why not to access objects directly? `pb.Referenceable` and `pb.Root` should be just wrappers around your own objects. -- Regards, Maxim
participants (4)
-
Gelin Yan
-
Itamar Turner-Trauring
-
Maxim Lacrima
-
Sergey Gerasimov