The bonobo-async interface duplicates much of the equivalent CORBA
asynchronous invocation functionality, in a non-standard way. This
is regrettable, but appeared neccessary at the time for various
reasons. This interface will be short lived, disappearing in the
next versions of Bonobo.
The bonobo-async code uses fully type driven marshaling, so before
you can invoke a method you need to fully describe the method you
wish to invoke by constructing its type data. You probably really
don't want to do this, however here is some example code to
demonstrate how it can be done:
Example 1. A chunk of the asynchronous moniker code
This callback is invoked either when the invocation
times out, in which case an ex_CORBA_COMM_FAILURE system
exception will be passed in ev. Or with a valid reply,
in which case arguments should be de-marshaled using
bonobo_async_demarshal.
When a user's async callback happens ( when a method's return data
arrives back ) this function is typicaly used by the callback
to de-marshal the arguments associated with the method, such as
the retval, and an array of pointers to memory in which to store
the returned InOut / Out arguments in order.
Given a type based description of a CORBA method
the method is invoked asynchronously. If an error occurs
in invocation an exception is fired in ev and cb will
never be invoked.
Otherwise, cb is invoked, either on the timeout - in
which case an ex_CORBA_COMM_FAILURE system exception will be
returned, or when the method returns with whatever data /
exceptions are relevant.
method :
method description
cb :
async callback
user_data :
associated callback user data
timeout_msec :
timeout in milli-seconds
object :
object to invoke method on
args :
array of ordered In/InOut arguments in same order as in method