1 Reply Latest reply on Jul 20, 2012 12:05 PM by csa

    asynchronous RPC handling?

    almac

      Hi,

       

      Is there any way to process RPC requests asynchronously, on the server-side?

       

      In the documented use of the RPC facility, methods which implement RPC interfaces

      always immediately return a result --- i.e. synchronous handling of RPC requests on

      the server-side.  Is there a way to get a callback passed to the server-side method,

      so that the server can return a result later, without blocking the worker thread?

       

      (The client-side interface, and the underlying messaging/bus, is already asynchronous,

      of course.)

        • 1. Re: asynchronous RPC handling?
          csa

          Hi Alvin,

           

          This is currently not possible, but I think it's a good idea. We could support returning a Future in remote interface methods. Would you mind creating a JIRA for this?

           

          As an alternative you could use conversational messages (server messages delivered to a single client in response to another event) using the MessageBuilder: https://docs.jboss.org/author/display/ERRAI/Conversations

           

          Note that this won't work for conversational CDI events as there the worker thread would have to reply directly (conversational context stored in ThreadLocals).

           

          Cheers,

          Christian