Duplex Communication (Pull + Push)
So far, we've discussed means of providing one-way ("simplex") communication with the client. The client makes a request to a service, and in return gets a response. However, sometimes you want to be able to provide two-way ("duplex") communication between the client and the server, in which the server can “push” messages to clients. The client establishes a connection with the server, which is kept alive, thus enabling the server to push messages to the client, and avoiding the need for the client to constantly poll the server for new data. This is particularly useful when you have continually changing data (such as a stock ticker), want to be able to send out notification messages to the clients, or are implementing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access