jeudi 21 mai 2015

Communication between synchronous and asynchronous points

I have three elements in my scenario:

A = browser
B = J2EE server listening for Websockets and simple GET requests
C = Java application connected to B with websockets

A makes GET request to B (synchronously), B sends Websocket message which holds request information, C responds back (asynchronously) and B should send back the response within the SAME context/request/thread as on the beginning.

A                       B                                 C
| ---- GET request ---> | ----- Websocket message ------> |
|                       | <---- Websocket response ------ |
| <---- response -----  |                        

My question is, how could I stop the GET request on the left side while waiting for the response from C. Can B act as an intermediary point between those synchronous/asynchronous elements?

Aucun commentaire:

Enregistrer un commentaire