Open naveenreddyin opened 4 years ago
Faust
includes a web server, so you can use it to expose an endpoint. Please read the documentation about HTTP. After receiving the data that you need, you can use your_topic.send
function to publish an event into your_topic
Hi @marcosschroh , thanks for replying back. I want the other way round. I want when topic gets a new message then it should signal the endpoint. Actually I want to do server side event using text/event-stream. I have updated my question now.
Good question! Seems a nice challenge!. I am not sure whether it is good practise to do that. Seems like you are trying to replace the agent functionality. When an event is published to a topic, it is processed by your agent (which is kind of the signal that you are describing). I will expect that after the event is processed by an agent, you will do a sink (storing in a Table, DB or sending an event to your client, SSE)
What do you think?
I have a simple app, with two functions, one for listening to topic and other for web endpoint. I want to create server side event streaming (SSE) i.e text/event-stream, so that on client end I could listen to it using EventSource. I have the following code for now, where each function is doing its particular job:
Now, I want in the index, something like this code, but using faust:
I have tried this:
But it gives me the following error:
I event tried this:
But I get following error:
Could there be a way for this? Thanks a lot in advance!