[omniORB] Callback
Steven W. Brenneis
brennes1@rjrt.com
Thu, 11 Nov 1999 16:42:40 -0500
The generally preferred method of implementing a callback is as follows:
IDL
interface callback {
<server required return> notify(<notification data>);
};
interface server {
<server methods>
void Register(in callback client);
void Unregister(in callback client);
};
The callback interface is actually implemented in the client and
contains a reference to the client-side target(s) of the notification.
It is assumed that the server keeps a reference (or list of references)
to the callback(s). To execute the callback, the server invokes the
notify method.
As to non-blocking behavior, the best way to insure this is to handle
any time-consuming processing on the server in a separate thread. This
would include callbacks. When a method is invoked on the server which
will result in callbacks, the server method implementation spawns a
separate thread to handle these.
The oneway semantic is intended for use in methods in which the delivery
of the method request is not guaranteed.
Hope this helps,
Steve Brenneis
Renny Koshy wrote:
>
> Does anyone know how to setup callbacks in omniORB? I've looked @ the
> IDL specs and omniORB docs without much luck.
>
> here's what I need to get working...
>
> GALClient: GALServer:
> ----- IncomingServiceReq ----->
> Does some processing
>
> <----- Indicate Acceptance ------
> Does some processing
>
> <----- Request Add'l info ---------
> Does some processing
>
> <----- Disconnect -----------------
> ------ Requester Dropped -------->
> <----- Write account entry --------
>
> This is ONE SERVICE REQUEST... however we don't want the system to
> block... i.e. the GALClient should be able to send service requests to
> other GALServers during this whole time.
>
> I figure if I send the ISR as a non-blocking, Async request, I can then
> proceed to go an do
> other things? But how do I do it?
>
> Thanks
>
> -Renny