I am trying to create reactive Service using Servicestack and Serversent Events. The thing I was doing is I post message to service. And directly push that message to actor. That is post only non blocking agent. Currently I am using F# actor but can be AKKA or any other. And then return accepted status code.
And from that I wanted to push processed message to Server Events. That eventually reach client in pushed fashion. I was trying to use Chat demo as reference but couldn’t quite make it work the server event part.
So, here are the queries
Am I on a right path to create reactive services?
Is there any good reference I can user other than chat or any suggestion to complete this reactive circle?
Let me know if anything is not clear or required more details.
Not sure I see why it needs to go through Server Events? SSE is essentially for providing server push events over HTTP.
I’d personally take the most direct possible, i.e. is there a reason why you can’t call the F#/Akka service directly? or whether the F#/Akka library can’t call ServiceStack services directly?
No, I can call. But the thing I wanted to achieve is user should not wait for processed message. And if connection is open for user it will receive pushed event from server whenever data is ready. I don’t want to block user for reply. So, I feel like SSE would be better option. Just create something like https://reactivetrader.azurewebsites.net/. It is created with SingleR, AFAIK and I was trying to do with SSE.
Thanks for short hand. I ll update the code tomorrow. But for second part NotifyAll(Object) is extension method that I can’t use without using open Servicestack and I was facing issue with async keyword. So, just to make it work I wrap it with module.