Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mercure Protocol integration #114

Open
AndiLavera opened this issue May 7, 2021 · 2 comments
Open

Mercure Protocol integration #114

AndiLavera opened this issue May 7, 2021 · 2 comments
Assignees

Comments

@AndiLavera
Copy link

Currently Athena::Routing::Response lacks support for websockets. Upon some investigation, HTTP::Server::Response#update_handler needs to be set & Athena::Routing::Response does not currently support that.

@Blacksmoke16 Blacksmoke16 changed the title [FR] Add support for websockets Add support for websockets Dec 22, 2021
@Blacksmoke16
Copy link
Member

So unfortunately after thinking about this for a while, I've come to realize that websockets just do not fit into the overall design of Athena. #129 could be used as a pretty decent solution in allowing usage of the stdlib's/external shard's HTTP::Handler websocket implementation without needing any changes to Athena.

The main downside of that is the integration between Athena and your websocket logic would be lacking (no DI/abstractions). Ultimately, I think a https://mercure.rocks/ integration would cover the majority of websocket use cases, while better fitting in with Athena's architecture. Can reference https://symfony.com/doc/current/mercure.html for how that might end up looking.

Going to repurpose this issue to represent that implementation.

@Blacksmoke16 Blacksmoke16 changed the title Add support for websockets Mercure Protocol integration Dec 23, 2021
@Blacksmoke16
Copy link
Member

Looked into this, and don't actually think it would be all that hard to integrate into the framework. There's still a good amount that needs to be figured out/cleaned up, but I put together a proof of concept: https://github.com/Blacksmoke16/athena-mercure

Overall it's pretty simple, just using normal HTTP stuff. Authentication is a bit more unique, but still mostly just cookies and HTTP stuff via JWTs. The repo could use some more helpers for like auth or discovery, and better way to configure things the way you want. This should be doable via #337 by having a dedicated Athena::Mercure::Bundle that allows configuring things/handling the integration between the framework and a more generic Mercure component.

Deff is something to look into once the config stuff is more ironed out.

@Blacksmoke16 Blacksmoke16 self-assigned this Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants