3 ms·
I'm waiting for a lib like Phoenix Channels with a js client that starts with WebSockets and falls back to long polling if things like firewalls get in the way.
by chessturk 7y ago
I'm waiting for a lib like Phoenix Channels with a js client that starts with WebSockets and falls back to long polling if things like firewalls get in the way. I actually found Phoenix when trying to solve that usecase in go.
I feel like because of Go's concurrency model, a standalone version of Phoenix Channels (without all the MVC stuff) would be possible to implement.
Phoenix: https://hexdocs.pm/phoenix/channels.html https://hexdocs.pm/phoenix/channels.html
- QuinnWilton 7y agoPhoenix channels don't really depend on MVC. It's common to make use of them in MVC apps, but they can be used standalone. I'm using Phoenix channels as a PubSub implementation in production, entirely separate from any web framework or HTTP request handling. As for the transport itself, Phoenix channels do have native support for both websockets and long polling, but I'm not sure offhand if it automatically falls back when websockets aren't available.
- jerf 7y agoConsider https://github.com/igm/sockjs-go/ https://github.com/igm/sockjs-go/ or https://github.com/googollee/go-socket.io https://github.com/googollee/go-socket.io . I have minimal experience with the first one, which has Just Worked, but it's always been in a situation where websockets worked, so I can't say I gave it a good workout. No experience with the second.