The following questions may influence your choice:
- how long the server needs to compute its result ?
- is the result for a unique request or is it broadcasted to several requesters ?
- how large is the data (payload) to be pushed ?
- are the clients always interested in all the results pushed ?
- can some results be lost, or must data always be delivered ?
- is it possible that clients loose connections or have connection quality issues ?
Based on these matters you may opt for a data push if:
- the connections are reliable
- or if the data is not too large
- or if the client is always interested in the results
- or if results need to be frequently updated
- or if the results are needed as realtime as possible
You may be interested in a push notificationpush notification or in SSEServer-Sent-Events (SSE) in all the other cases, and for example to cope with:
- reconnectsreconnects (with SSE) and closed client applications
- network quality issues when transmitting large sets of data that would make postponing the transmission a more pleasant alternative (or take into account huge roaming costs when using a cell-phone abroad...)
- ignore obsolete requestsresults
- if server side constraints do not allow full-duplex or require to go over http
Note however that SSE is not as well supported by browsers as websockets, certainly making the later the easier choice.