News for hackers. Stuff that matters.
Re:Use Phoenix Channels by cultofmetatron on Wednesday August 04, 2021 @11:00AM (#28061775)
This powers the realtime sync at my startup. its the closests thing Ive ever found to "just drop it in and it just works" for self hosted websocket systems.
Re:Use Phoenix Channels by jkarneges on Wednesday August 04, 2021 @11:36AM (#28062238)
> just drop it in

Have you looked at Pushpin [1]? (disclosure: I'm the lead dev). The goal is to be able to add it to anything, rather than requiring a certain language.

[1] https://github.com/fanout/pushpin

Re:Use Phoenix Channels by aloukissas on Wednesday August 04, 2021 @12:20PM (#28062841)
I haven't, thanks for the pointer! However, the main reason I chose Elixir/Phoenix for this project was not for the language itself, but for the runtime/VM (BEAM), which is battle-tested for such use cases.
Re:Use Phoenix Channels by ch4s3 on Wednesday August 04, 2021 @12:14PM (#28062755)
This seem pretty nice. How does it handle things like websocket reconnection?
Re:Use Phoenix Channels by jkarneges on Wednesday August 04, 2021 @12:48PM (#28063244)
Whenever a client connects (whether the first time, or on reconnect) or sends a message, Pushpin sends an HTTP request to a configured backend to retrieve WebSocket messages to be delivered to the client. This can be used to restore state on reconnect.

If you mean how is reconnection handled on the client side, that's up to the client. Pushpin is a server-side component with no client library. But the client could use a WebSocket library with reconnection ability, like reconnecting-websocket.

Re:Use Phoenix Channels by paulgb on Wednesday August 04, 2021 @02:48PM (#28064694)
> "just drop it in and it just works" for self hosted websocket systems

I was also been underwhelmed by options in this area, so I've been working on a Rust library called Jamsocket[1]. The idea is that all you need to do is implement a trait, overload the functions for the events you want to handle (new connection, message, etc.) and deploy it.

I still need to work on production aspects of it, but it's in a state where you can play with it for local development, so I figured I'd share it here in case any Rust developers want to tinker with it.

[1] https://github.com/jamsocket/jamsocket

Re:Use Phoenix Channels by aloukissas on Wednesday August 04, 2021 @11:28AM (#28062144)
Same here. It was a breeze to build a scalable, real-time auction system with Phoenix Channels at the previous startup I was working at. There are definitely "devil in the details" corner cases, but for the most part it works beautifully without much effort :)
Re:Use Phoenix Channels by sergiotapia on Wednesday August 04, 2021 @01:57PM (#28064124)
Meteorjs was like this, even simpler I would say. But their Achilles heel was minimongo tie in and scalability issues.

aw how i miss you meteor

Re:Use Phoenix Channels by cultofmetatron on Wednesday August 04, 2021 @02:42PM (#28064613)
meteor is still around.

That said, phoenix/elixir's live view accomplishes the same thing in a database agnostic way. its sync system is built on channels and scales WAY better than meteor ever could.

Re:Use Phoenix Channels by sergiotapia on Wednesday August 04, 2021 @02:44PM (#28064638)
yes meteor is still around but it's warts make it a nonstarter for me now that I know how it usually goes when in prod
Re:Use Phoenix Channels by cultofmetatron on Wednesday August 04, 2021 @04:03PM (#28065599)
try phoenix's liveview. Beam is built for scaling thousands to millions of stateful processes on a cluster. That at its core was the biggest bottleneck for meteor and for elixir, its more or less a solved problem unless you're talking about google or amazon levels of traffic
Re:Use Phoenix Channels by syoc on Wednesday August 04, 2021 @03:26PM (#28065137)
Not that familiar with current web technology. What do you mean with "self hosted" websocket systems?
Re:Use Phoenix Channels by cultofmetatron on Wednesday August 04, 2021 @04:04PM (#28065615)
it means the infrastructure for doing a thing is hosted on your machine as oppossed to being served by a third party vendor on their servers. Think pusher or pubnub for instance.