ServiceStack Server Sent Events/push notification (SSE)

两盒软妹~` 提交于 2019-12-11 10:02:29

问题


Can anyone guide me as how server sent events works in servicestack framework. I want to get response to load asynchronously. If a response contains a list of items, I want the list of items to populate while the service is processing the list.

Suppose, I have a response object, company which contains list of permanent employee and list of contractual employee which comes from two different sources. I want the response object to populate the list of employees which is processed first. I don't want to wait for the response object to bind the list of permanent employees and contractual employees and then send me the result. Once the list of permanent employee is processed, it should send me the response immediately. Please guide me how to achieve this functionality.


回答1:


As far as I understood your question, client doesn't want to wait till server finished processing the data and therefore you want to get the data before that, continuously.

So, if you are flexible and can use some other technology for that purpose I suggest using SignalR. Server will be able to push data to client 'in a stream'.



来源:https://stackoverflow.com/questions/31617259/servicestack-server-sent-events-push-notification-sse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!