in reply to recommended approach to publish asynch messages to web browser

antichef:

I've been experimenting with Websockets lately for a project. Perhaps that would be an approach you might like? I've not used them in Perl yet. $job is using C++/Java/JavaScript/Python, so all my Websocket experience so far is in C++/Java. I notice that there's a Net::WebSocket module available on cpan, so it shouldn't be too much trouble to get going.

I've found the server side of Websockets to be pretty simple, and though I've not written the JavaScript side, I *did* look at it while debugging some time back, and it looked pretty simple. (I don't recall which (if any) JavaScript module we used on the browser side.)

...roboticus

When your only tool is a hammer, all problems look like your thumb.

  • Comment on Re: recommended approach to publish asynch messages to web browser

Replies are listed 'Best First'.
Re^2: recommended approach to publish asynch messages to web browser
by antichef (Acolyte) on Sep 10, 2017 at 19:41 UTC
    I've definitely gotten the furthest with Net::WebSocket::Server -- but every time I start the event loop to listen for ZMQ messages, the thread effectively blocks. If I put it in the "on" "ready" section of the websocket connection, it actually works, with events going out to the browser, but the server is unable to handle additional connections and I can't handle disconnect/clean up. It could be that I'm just missing something simple, but at this point I'm suspecting that I'm missing something bigger.