Suppose I want to stream data from a remote service to myself. I am now thinking that this is polling only.Â I call the remote service to get any available data. However, if the remote service does not have data this leads to either locking (the remote service waits until data comes available) or unwanted network traffic (the remote service says "I have nothing"). I can use Async calls but this still requires me to poll the Future to find out if there is data available.
To continuously push data from the remote server when it becomes available I need to "reverse" e.g. I have to make a service available that the data provider can consume and it can then push whenever new data is ready without me having to poll (either through a Future or any other primitive way).
I wish I could consume a remote service and then set a callback that it could call whenever data is available.