Re: MateCORBA2 versus hanging method calls

Hi Joe,

On 12 Oct 2001, Joe Shaw wrote:
> On Thu, 2001-10-11 at 22:10, Michael Meeks wrote:
> >         Thirdly - there is builtin ASync support in MateCORBA2 - a bit
> > like matecomponent-async, but using the infastructure inside MateCORBA2 [
> > that superceeds matecomponent-async by an order of intelligence ], so -
> > it should be possible to make nice async methods for things that
> > might take a long time, and invoke a standard CORBA method
> > asynchronously without any fooling around in the IDL.
> 
> Cool!  How does one utilize this functionality?

	Ah; wait - let me just commit. So, there is an example (
regression test ) in MateCORBA2/test/everything/client.c search for Async.
Essentialy however you just need this:

typedef struct _MateCORBAAsyncQueueEntry MateCORBAAsyncQueueEntry;

typedef void (*MateCORBAAsyncInvokeFunc) (CORBA_Object          object,
				      MateCORBA_IMethod        *m_data,
				      MateCORBAAsyncQueueEntry *aqe,
				      gpointer              user_data, 
				      CORBA_Environment    *ev);

/* Various bits for Async work */
void MateCORBA_small_invoke_async        (CORBA_Object           obj,
				      MateCORBA_IMethod         *m_data,
				      MateCORBAAsyncInvokeFunc   fn,
				      gpointer               user_data,
				      gpointer              *args,
				      CORBA_Context          ctx,
				      CORBA_Environment     *ev);

void MateCORBA_small_demarshal_async     (MateCORBAAsyncQueueEntry  *aqe,
				      gpointer               ret,
				      gpointer              *args,
				      CORBA_Environment     *ev);


	so you do something like MateCORBA_small_invoke_async (cb), and
inside the cb you do MateCORBA_small_demarshal_async (queue_entry), and
that's about it really.

	Of course - it would be quite easy to write IDL compiler
support for async stubs / skels; all that really needs doing is to sit
down and spec. up the ABI, I don't believe the OMG helps us there.

	The 'gpointer *args' is a standardly normalized array of
argument indirectors - as defined in
MateCORBA2/docs/internals/interface-indirection.gnumeric.

	HTH,

		Michael.
