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

Tree listener for WebSockets (NNG_OPT_WS_TREE) #1374

Open
EvanBalster opened this issue Dec 15, 2020 · 0 comments
Open

Tree listener for WebSockets (NNG_OPT_WS_TREE) #1374

EvanBalster opened this issue Dec 15, 2020 · 0 comments
Labels
Milestone

Comments

@EvanBalster
Copy link
Contributor

This came out of a discussion with @gdamore on Discord. I probably don't need this feature for my own application; specifically, I am writing a request router for persistent connections with its own trie structure.

Currently there's a feature in NNG where HTTP microservices can respond to a "tree" of URIs. I believe this could also be useful for some use-cases with WebSockets.

Garrett suggested this option would take the form of an option "NNG_OPT_WS_TREE", indicating that dialers to a sub-path should connect to the (longest) tree which is a prefix of that sub-path.

For example, a server might host the following WebSocket paths, all as trees:

/orchard
/orchard/fruit
/orchard/fruit/apple
/orchard/fruit/orange
/orchard/nut
/orchard/nut/almond

If I were to request /orchard/fruit/banana, I would connect to /orchard/fruit which is the longest existing parent path. This would allow for a sort of fallback from specific services to service classes.

@gdamore gdamore added the http label Jan 17, 2021
@gdamore gdamore added this to the v1.5 milestone Jan 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants