I'm new to Server Sent Events... I have a recurring background rake task that, every minute runs a calculation. I would like the results of this calculation to be sent to my webpage where the JS will parse it accordingly to show on the page.
I'm not sure how to achieve this... the rake task is working, each minute, the calculation is being run. I've followed an SSE tutorial to correctly implement SSE. Now... I'm not sure how to combine the two...
SSE is run from inside a controller action, that corresponds with a page that events are published to. But then... calling a controller action in a rake task seems to defy MVC convention (though if I misunderstand and it doesn't, I can follow the answer here). So how else can I achieve this?