Home Help Center

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

hulkaspeedhulkaspeed Member pablo gonzalezOrganization: STLProject: Integral Management Of State Games (lottery,sports
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

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    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.
  • hulkaspeedhulkaspeed Member pablo gonzalezOrganization: STLProject: Integral Management Of State Games (lottery,sports
    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!!
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    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.
  • hulkaspeedhulkaspeed Member pablo gonzalezOrganization: STLProject: Integral Management Of State Games (lottery,sports
    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....
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    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.
  • hulkaspeedhulkaspeed Member pablo gonzalezOrganization: STLProject: Integral Management Of State Games (lottery,sports
    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??
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    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.
  • hulkaspeedhulkaspeed Member pablo gonzalezOrganization: STLProject: Integral Management Of State Games (lottery,sports
    Yes,sorry, I saw it later, thank you very much for all your supporting...
Sign In or Register to comment.