-
Notifications
You must be signed in to change notification settings - Fork 39
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
.NET client configuration "Update" event #149
Comments
Hi @beefo, thanks for opening this issue. I'll reach out to the rest of the team and hopefully we'll be able to get back to you soon. |
@nunogois Just checking back to see if you and the team had a chance to consider the improvement? |
Hi @beefo I wanted to clarify and align on something. The example you linked to, is an in-process solution that's hooked to the polling cycle here: which emits the event when features have changed:
I believe this will not work as you expect, because the event is triggered after the pull cycle, re-pulling the state would be unnecessary as it will be fresh. Our clients do not use web sockets to communicate with the server, they use a fetch-all request inside a poll cycle. If that's the problem you want to solve, maybe you can look into https://docs.getunleash.io/reference/addons/webhook which can call an external HTTP endpoint when a feature is changed in the server. If you want to communicate with multiple clients you can have a serverless function that can re-post this event to a pub/sub queue that the clients can subscribe to. But maybe I'm going too far into the solution space without having the proper context. For sure .NET can have a similar functionality as the JS proxy, but I just want to understand better the motivation |
Hi @gastonfournier thanks for getting back to me. I think that is indeed what we want. Details of our use case aside, what the js client provides is exactly what we want in the .NET client. An event fired after the poll that tells us if any feature has been changed. We would use this event to let our front end(s) know to pull the updated feature flag states. We are not using the Unleash js client on our front end. The implementation details of us using web sockets, etc is mostly irrelevant. I was just trying to provide as much context as possible. I think I may have rather caused some confusion. What it boils down to is we need the .NET client to let us know when a feature has changed. |
Hi @beefo! We have this in our backlog but is not a high priority at the moment. The implementation will follow the pattern of Error Events and Impression Events, with callbacks registered on the |
We also have an application (.net API) that could benefit from this feature. I actually started looking into it today when I came across this request. I'm planning to try this out locally (following the existing event pattern within the Unleash dotnet SDK). If I make any progress, I'd be happy to contribute. |
@beefo We have just released Unleash-Client 3.1.0 with @YayBurritos' contribution, should be up on NuGet now! |
Thanks @YayBurritos @daveleek! |
Is your feature request related to a problem? Please describe.
We are using the .NET client. There are some parts of the code which we would like to listen for configuration changes and trigger an action dynamically based on if a feature changed.
Example:
We don't use the js library, we wrap our own API method to get feature flags. We want to set up an event handler on the "update" event and send a message via existing web socket to the client to re-pull feature flag states.
Describe the solution you'd like
Add "Update" event which get's emitted every time the Unleash Proxy returns a new feature toggle configuration. Similar to js client. Perhaps even having parifty of the events.
Describe alternatives you've considered
Unleash event log with web hook. This would be a complex and round about solution on our end. We have a distributed system. We would need to set up a new service with an endpoint for Unleash event logs, have all services "in-touch" with it, and notify all clients when a feature state changes. Essentially duplicating what the Unleash client already does.
Additional context
The text was updated successfully, but these errors were encountered: