[omniORB] Colocated Client & Impl in Python

Duncan Grisby dgrisby@uk.research.att.com
Thu, 02 Mar 2000 13:55:44 +0000


On Thursday 2 March, Richard Gruet wrote:

> I know that OmniORB supports that Server & client reside in the same
> address space, but I did'nt find any example in Python.
> Is it the same sequence of operations as usual [init ORB, activate POA,
> create an impl. object and get its objref via ._this()] ? And since the
> client is in the same process, is it enough to avoid the blocking call:
> orb.run() in the server part ?

Yes, everything works as you would expect. When you're holding an
object reference which you got with _this(), you can invoke on it just
like any other object reference. The call will be much more efficient
than a remote call.

With omniORBpy (and omniORB C++ too), orb.run() is never necessary.
There is no ORB main loop (that the user can get at), since everything
is handled by separate threads. If you look at the implementation of
orb.run() in omniORBpy, you'll see that it's just a while loop
containing calls to time.sleep(). orb.run() is just a convenient way
of preventing your main thread from exiting.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --