Archived

This forum has been archived. Please start a new discussion on GitHub.

Which is the best way to do some jumps and return??

Hello,
We are trying to test Ice doing thousands of transactions in an asynchronous way.Every transaction has to do five "jumps" to reach the process that performs the operations and this returns one value to the first-client process.
I have seen that AMI only uses callback to notify to the previous process that it finishes its operation,but...is there any way to notify between the client process and the last process using callbacks?? maybe is a better option using IceStorm??

Thank you,and sorry we are lost in this new Ice world!! :)

Comments

  • benoit
    benoit Rennes, France
    Hi,

    I believe AMD will allow you to do what you want. See the Ice manual and demo/Ice/async for example.

    In short, the processes which are between the client and the final server will dispatch the request with AMD and forward it to the next server with AMI. The AMI callback will use the AMD callback to send the response back to the previous server.

    Cheers,
    Benoit.
  • Thanks Benoit for your answer, but still I have some questions...

    "In short, the processes which are between the client and the final server will dispatch the request with AMD and forward it to the next server with AMI. The AMI callback will use the AMD callback to send the response back to the previous server."

    When we call,for example, from second server to the async method of the third server,second server's AMI callback will be invoke inmediatly not waiting until the transaction reach the final server, what can I do to solve this point??
    Thanks!!
  • benoit
    benoit Rennes, France
    Yes, this should easy if you use AMD/AMI on the intermediary servers. For example, the implementation of the second server would be something like the following:
       class AMICallback extends AMI_MyInterface_op2
       {
            AMICallback(AMD_MyInterface_op cb)
            {
               _cb = cb;
            }
    
            public void ice_response()
            {
                // Send the response of op() only once the op2() response is received.
                _cb.ice_response();
            }
    
            ...
       };
    
       void op_async(AMD_MyInterface_op cb)
       {
            thirdServer.op2_async(new AMICallback(cb));
       }
    

    Please see the Ice manual for more information on AMI/AMD.

    Cheers,
    Benoit.
  • Thanks, I've been read documentation but still there is one thing is not clear to me, how can I do the first call from the client?? because I have to pass an AMI callback that needs an AMD_op in the constructor ,and that AMD_op comes inside the async call which don't receive the client....
  • benoit
    benoit Rennes, France
    Hi,

    Since the client isn't dispatching any calls, it doesn't need AMD. AMD is really a server-side concept only. So, your client should either use a regular twoway invocation to call on the server or use AMI with a callback object that doesn't need any AMD callback object.

    Cheers,
    Benoit.
  • Yes,I did it,sorry to ask you for that.We have now one only problem,that we don't know if is possible, can an ice_response has more than one parameter??
  • benoit
    benoit Rennes, France
    The number of parameters of the generated ice_response callback depends on the number of return/out parameters of the Slice method. See the Ice manual here for more information.

    Cheers,
    Benoit.
  • Yes,sorry, I saw it later, thank you very much for all your supporting...