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

WIP: Nut-17 #394

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

WIP: Nut-17 #394

wants to merge 17 commits into from

Conversation

crodas
Copy link

@crodas crodas commented Oct 8, 2024

Very early stage nonfunctional prototype to add support for any subscriptions, aiming for NUT-17 support, #203 .

TODO:

  • Write tests for event generation inside the existing Mint tests
  • Write unit tests for the websocket client and external tests (if possible)
  • Does it worth to make it opt-in or possible to disable subscriptions?
  • Add Signaling Support via NUT-06 (6fafbfd)

Very early stage non functional prototype to add support for any kind of
subscriptions, aiming for NUT-17 support
There are two functions, an async and a fire and forget version
This implementation does not rely on any new crate, instead it implements the
types for the WebSocket.

This is WIP, so this commit will be rebased and keep changing
@crodas crodas force-pushed the nut-17-ws-subscription branch 2 times, most recently from c1cdd09 to be9ce64 Compare October 9, 2024 22:31
Also dropped `tokio::select` since it is not stable in 1.63
@thesimplekid
Copy link
Collaborator

Hey, haven't done a very through review but it looks like a good approach so far, thank you for you work. If there is a specific part you would like me to look at let me know.

Instead of letting Axum create it and use it for their WebSocket, make it part
of Mint so that event subscriptions and publishing can happen in all layers.

Also added helper functions to emit events

Some typos in comments were fixed in this commit as well
@crodas
Copy link
Author

crodas commented Oct 10, 2024

@thesimplekid I have no idea where the events are being generated, and any other feedback is more than welcome.

I think the `subscription_manager` was a bit unintuitive; I think
`pubsub_manager` is a much more descriptive name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants