REST Api SSE in Unity3D
Im building a OpenHab (Home Automation) UI in Unity and use REST api from server. Openhab has an Eventbus exposed to 3rd party software as Server Side Event that you can subscribe to.
I managed to GET and PUT objects via the rest api. But how would one subscribe to the eventstream.
I used the REST Client for Unity asset from assetstore to make the api calls simple. My thought is to run something similar to DownloadHandler but infinite and handle events and pass them on to a unity eventsystem and then update UI thorugh that.
Answer by inmortal · Oct 07, 2019 at 12:20 PM
Answering my own question for future reference...
As in turned out, after a little bit more research. This was very simple. I imported this library (EvtSource) and ran the example and it worked fine as I intended from the beginning.