Send data to front end when back end updates

后端 未结 3 1133
天命终不由人
天命终不由人 2020-12-31 07:55

The backend of my web application receives updates from several clients. When such an update happens it should be communicated to all other clients.

How can I initia

3条回答
  •  旧巷少年郎
    2020-12-31 08:22

    When you say front end, you are talking about stateless http client.

    You cant push anything from your web servers to http or stateless clients.

    The "trick" to do this if using asynchronous calls from front end to your back end, periodically.

    Think about gmail, how do you think it displays that you have an email when you recieve a new email. You browser contantly, sending Asynch calls to gmail servers, if and when there is a new message, it displays it.

    So Clients are stateless. use Ajax.

    is this clear?

提交回复
热议问题