-
Notifications
You must be signed in to change notification settings - Fork 7
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
refactor(ffi): refactor engine for streaming #430
Conversation
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
…ipt-io/flipt-client-sdks into refactor-engine-for-streaming * 'refactor-engine-for-streaming' of https://github.com/flipt-io/flipt-client-sdks: build(deps): bump org.junit:junit-bom in /flipt-client-java (#429) build(deps-dev): bump rollup in /flipt-client-browser (#428) build(deps-dev): bump rollup in /flipt-client-react (#427) build(deps-dev): bump globals in /flipt-client-react (#426) build(deps-dev): bump eslint-plugin-react in /flipt-client-react (#425)
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #430 +/- ##
==========================================
- Coverage 87.42% 84.09% -3.33%
==========================================
Files 9 8 -1
Lines 3737 3936 +199
==========================================
+ Hits 3267 3310 +43
- Misses 470 626 +156 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
…ipt-io/flipt-client-sdks into refactor-engine-for-streaming * 'refactor-engine-for-streaming' of https://github.com/flipt-io/flipt-client-sdks: feat(browser): allow caller to know if the snapshot was updated (#431)
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
…ipt-io/flipt-client-sdks into refactor-engine-for-streaming * 'refactor-engine-for-streaming' of https://github.com/flipt-io/flipt-client-sdks: build(deps-dev): bump @eslint/js in /flipt-client-react (#447) build(deps-dev): bump @types/react in /flipt-client-react (#445) build(deps-dev): bump globals in /flipt-client-react (#443) build(deps-dev): bump typescript in /flipt-client-browser (#442) build(deps-dev): bump undici in /flipt-client-browser (#441) build(deps-dev): bump black in /flipt-client-python (#440) build(deps-dev): bump @types/node in /flipt-client-node (#439)
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
@GeorgeMac I think this is ready for a re-review |
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one.
Do we want to add comments to all these new Streaming enum types to make it clear this is experimental / cloud only for now?
yah will do |
) -> Result<(), Error> { | ||
let stream_result = self.fetch_stream().await; | ||
|
||
match stream_result { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's too late. Could serde_json::StreamDeserializer be used here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe, this works however. do you know if serde_json::StreamDeserializer
would provide a benefit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am worry about bytes and \n
on utf-8 string. But it could be done with refactoring.
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
…ipt-io/flipt-client-sdks into refactor-engine-for-streaming * 'refactor-engine-for-streaming' of https://github.com/flipt-io/flipt-client-sdks: feat: expose if refresh changed state in node sdk (#450)
Im going to add more tests coverage and document the new streaming option before merging |
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Opening this up for feedback. It hasnt yet been tested with streaming server side changes yet, however I feel like this PR is large enough already that we should go ahead and open it.
What
Refactors the
flipt-ffi-engine
module with the following major changes:HTTPParser
toHTTPFetcher
P
from evaluator as it will always use theHTTPFetcher
(could prob do the same forSnapshot
store in the futurerepace_store
to just usereplace_snapshot
on state changePolling / Streaming Flow
This adds initial support for flipt-io/flipt#3458
The client will be able to be configured in either streaming or polling mode. Default will be polling, but they will be able to enable streaming via engine options (yet to be decided how this is exposed to user).
Right now this only is a refactor of the existing polling code, as the streaming functionality is never called.
TODO