cLiPPi

cLiPPi

Phoenix and Mercure

Hey all,

I wonder if you have ever heard of / discussed Mercure, which is a protocol for real-time communication and kind of an abstraction of pub-sub.
I think that Phoenix channels are quite on par with the functionality it offers, but still wonder if anything could be gained by writing a Phoenix-Channel based implementation for a hub / server.

As far as I can see, several frameworks, i.e. Symfony and Laravel, include modules to use a mercure implementation to publish updates to client applications via HTTP/2.

There is a reference implementation written in Go, but as far as I can tell, having an Elixir implementation (which would probably perform very well) could help spread Elixir to other ecosystems such as PHP in a world where real-time updates become more important.

What do you think?

First Post!

wolf4earth

wolf4earth

Disclaimer: up until now I’ve never even heard of Mercure. So my impression might be totally off.

From what I see at a glance I fail to gather how having support for Mercure would provide a tangible advantage over what Phoenix channels already provide today.

Why do you think it would help to spread Elixir to other ecosystems?

Most Liked

LostKobrakai

LostKobrakai

Seems like Mercure was created to make persistent connection easier for non-persistent server environments or languages. So they created a hub between the client and the server. If you already have a client speaking their protocol then phoenix could probably be hub and application server in one. For new projects I’m not sure I’d be interested in it though.

Last Post!

cLiPPi

cLiPPi

I already mentioned I think channels are on par with the things it offers. That is why I think it would probably be very easy to implement a hub in elixir with phoenix channels.

I could also imagine streamlining the client-side channel javascript client with this protocol. Not sure if that is worth anything, but it would allow channel-based code to work with any hub.

The more concrete usecase for a hub would be adding real-live functionality to languages lacking a good tool for that (like PHP). A hub implementation (possibly the one in Elixir) could be used to overcome this for existing apps written in, say, Symfony (or any other framework that happens to have a Mercure module).

This thread is not to convince anyone that there would be merits to this. It is more trying to gather your thoughts if there are merits.

Where Next?

Popular in Discussions Top

AstonJ
If a newbie asked you about Phoenix Contexts, how would you explain the basics to them? Feel free to be as concise or in-depth as you li...
New
lorenzo
Hey everone! I created a prototype for my app using Nodejs for the api. But the framework I chose wasnt great (in general theresnt any g...
New
nburkley
AWS re:Invent is on at the moment with some interesting announcements. One new feature in particular is the Lambda Runtime API for AWS La...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
cvkmohan
The upcoming Phoenix 1.6 release looks very interesting. Became a habit to watch the commits - and - what they are bringing in. phx.gen...
New
shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped I am still new to Elixir, so can’t really judge ...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31586 112
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44265 214
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

We're in Beta

About us Mission Statement