Archived

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

Help about one usage of AMD

Ice 3.1.0 Manual(Page 849) says:
An alternate use case for AMD is an operation that requires further processing 
after completing the client’s request. In order to minimize the client’s delay, 
the operation returns the results while still in the dispatch thread, and then 
continues using the dispatch thread for additional work. 

It seems that this use case has no relationship with AMD. Can you explain a little more ? Thank you very much!

Comments

  • mes
    mes California
    Hi,

    The only way a servant can complete a request and then continue using the dispatch thread is with an AMD operation:
    void doWork_async(AMD_I_doWorkPtr cb, const Ice::Current&)
    {
        // Execute the operation...
        cb->ice_response(...); // Complete the request
        // Continue using the dispatch thread without delaying the client...
    }
    
    Clearly this is not the typical use case of AMD, but it might be useful in special cases.

    Take care,
    - Mark