Question about AMI

in Help Center
hi, there,
If I define a slice like this:
module test
{
["ami"] bool foo();
}
then a function will be produced: void foo_async(....),
1) This invocation is one-way , isn't it?
2) For sequentially-sent AMIs, it is not guaranteed that the dispatches in server will not be out-of-order since these AMIs are one way.
TIA
OrNot
If I define a slice like this:
module test
{
["ami"] bool foo();
}
then a function will be produced: void foo_async(....),
1) This invocation is one-way , isn't it?
2) For sequentially-sent AMIs, it is not guaranteed that the dispatches in server will not be out-of-order since these AMIs are one way.
TIA
OrNot
0
Comments
Sequential AMI calls, i.e., if you send one AMI call, wait for the callback, then send the next AMI call, are dispatched in order, just like regular twoway calls. Non-sequential AMI calls, i.e., if you send one AMI call after another without first waiting for the first AMI call to complete with a callback, can be dispatched out of order, provided that you use more than one thread in the thread pool.
Can I understand :
the foo_async() will soon return to the caller thread as soon as it puts the data into the socket stack and without needing the acknowledgment from server, which acts like oneway invocation . That is, the
caller doesn't know the exact time the data is delivered on the wire and the invocation is dispatched in server .
Right. The Ice run time simply writes the request to the corresponding socket and returns control to the caller immediately. Any errors that might occur when the data is sent or when the reply is unmarshaled are notified via the ice_exception callback.
Not quite. For a oneway invocation, the caller is not notified of errors whereas, for an AMI invocation, the call is notified of errors.
Not really. The request is written immediately. It's just that the reply is delivered asynchronously.
Cheers,
Michi.