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

Why do ExtractServiceName and ListServices take an instance of *ServiceRouter? #406

Closed
favonia opened this issue Nov 5, 2023 · 5 comments

Comments

@favonia
Copy link
Contributor

favonia commented Nov 5, 2023

Hi, I have a question about the API: is there a reason for ExtractServiceName and ListServices to receive an instance of *ServiceRouter? I understand that the code right now does not use it, so I can even pass nil into it, but I worry that maybe it is not the "intended" use of the API. (That is, I hope that my code will still work after upgrading the library in the future.)

@piksel
Copy link
Member

piksel commented Nov 5, 2023

I think that is precisely why they take those. We don't break API compatibility between versions, so it's probably just a leftover. There will probably be a new API for v1.0, but it's not something you can really prepare for yet.

@favonia
Copy link
Contributor Author

favonia commented Nov 5, 2023

I see, thanks. On the other hand, is there a way to extract the list of services in a ServiceRouter (not all available services)? Sorry but I got a bit confused by the current API. If not, that's okay. It just means I probably should extract the service names and keep them separately.

@piksel
Copy link
Member

piksel commented Nov 5, 2023

No, unfortunately not. This is in part because there is no identifier for services that can be retrieved by calling the service API. Effectively, all services have a unique URL prefix which could be used for this purpose, but the interface doesn't expose it for now. It's something I have planned to add at some point...

@favonia
Copy link
Contributor Author

favonia commented Nov 5, 2023

Let me close this issue then, because my original question was answered. My impression is that the current API is probably not ideal but could not be changed due to backward compatibility, and there might be a v1.0 API that addresses these issues. Anyway, thanks!

@favonia favonia closed this as completed Nov 5, 2023
@piksel
Copy link
Member

piksel commented Nov 5, 2023

I added a PR for a way to list the services instances:
#409

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

No branches or pull requests

2 participants