-
Notifications
You must be signed in to change notification settings - Fork 17
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
poll_for_updates discussion #52
Comments
That's a good question. I'm not entirely sure about the reasoning behind the design decisions in this library, but @rbtcollins would probably have some useful insights here. @sighphyre might also have some useful input. |
From the docs: "As the client specification requires sending background metrics to the API, you will need to arrange to call the poll_for_updates method from a thread as demonstrated in examples/threads.rs" (And since it also supports async networking, you can do that from a tokio task or whatever as well if you like). The example code on that page has this:
which demonstrates both doing polling for updates, and doing a graceful shutdown of the poller - though thats not needed if you like you can just drop the tokio task. |
Perhaps I misunderstood the question? |
Sorry for not responding sooner. I can't speak for the OP, but I interpreted it as "why do we have to set it up ourself" / "why doesn't the SDK do it automatically". The docs say you have to do it yourself, but it doesn't explicitly say why as far as I can tell. Presumably it's because you need an async runtime and the SDK doesn't pick one for you? |
I would also like to know why the Rust client SDK requires you to setup the polling yourself. I have used the Unleash SDKs for other languages (Java, Python, Go) and none requires you to do that. It's always just: 1) create a client instance and 2) call isEnabled(). TBH, as an application developer I don't want to be bothered with setting up the details of a library like this. Could the Rust SDK support this simpler usage, too? |
Describe the feature request
It would be helpful to understand the design decision not to automatically support execution of poll_for_updates.
Is the library trying to remain as agnostic as possible to different execution models -
std::thread
tokio async/await
etc?Or was there a total misunderstanding and we are able to configure the library to fetch updates?
Background
No response
Solution suggestions
No response
The text was updated successfully, but these errors were encountered: