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

feat: Eventing #187

Merged
merged 21 commits into from
Oct 10, 2022
Merged

feat: Eventing #187

merged 21 commits into from
Oct 10, 2022

Conversation

james-milligan
Copy link
Contributor

@james-milligan james-milligan commented Oct 4, 2022

This PR

  • adds eventing rpc
  • events are emited on successful connection to stream rpc and configuration changes

This PR adds a new rpc to the connect service called EventStream, it accepts an empty proto message google.proto.Empty and returns a stream of message type EventStreamResponse.
EventStreamResponse contains a single string field of type which references an internal notification type used within flagd, such as provider_ready or configuration_change. This rpc will allow for the management of the sdk cache, busting it once a configuration change is detected. It will also allow for the implementation of flag change events once/if the OFEP passes.

Signed-off-by: James-Milligan <james@omnant.co.uk>
Signed-off-by: James-Milligan <james@omnant.co.uk>
Signed-off-by: James-Milligan <james@omnant.co.uk>
Signed-off-by: James-Milligan <james@omnant.co.uk>
Signed-off-by: James-Milligan <james@omnant.co.uk>
Signed-off-by: James-Milligan <james@omnant.co.uk>
Signed-off-by: James-Milligan <james@omnant.co.uk>
Signed-off-by: James-Milligan <james@omnant.co.uk>
Signed-off-by: James-Milligan <james@omnant.co.uk>
Signed-off-by: James-Milligan <james@omnant.co.uk>
Signed-off-by: James-Milligan <james@omnant.co.uk>
@toddbaert
Copy link
Member

toddbaert commented Oct 4, 2022

@AlexsJones just for some background, one of the coolest parts of this is it allows providers to cache resolved flag values (based on a sha of the flag-key and context). The provider can then intelligently bust that cache when the flagd configuration changes because it will get an event indicating such. This significantly reduces traffic and latency, even in server deployments. You can imagine that if user X has already evaluated flag "banner-color" seconds ago, there's no reason to evaluate that again.

Signed-off-by: James-Milligan <james@omnant.co.uk>
config/samples/example_flags.json Outdated Show resolved Hide resolved
pkg/eval/json_evaluator.go Outdated Show resolved Hide resolved
Signed-off-by: James-Milligan <james@omnant.co.uk>
@AlexsJones
Copy link
Member

@AlexsJones just for some background, one of the coolest parts of this is it allows providers to cache resolved flag values (based on a sha of the flag-key and context). The provider can then intelligently bust that cache when the flagd configuration changes because it will get an event indicating such. This significantly reduces traffic and latency, even in server deployments. You can imagine that if user X has already evaluated flag "banner-color" seconds ago, there's no reason to evaluate that again.

It's a good move, I think the interfaces are getting a bit bruised though - suggesting we encapsulate with a configuration object.

Signed-off-by: James-Milligan <james@omnant.co.uk>
Signed-off-by: James-Milligan <james@omnant.co.uk>
james-milligan and others added 3 commits October 7, 2022 13:52
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Signed-off-by: James Milligan <75740990+james-milligan@users.noreply.github.com>
Signed-off-by: James-Milligan <james@omnant.co.uk>
Signed-off-by: James-Milligan <james@omnant.co.uk>
@james-milligan james-milligan merged commit 3f7fcd2 into open-feature:main Oct 10, 2022
@james-milligan james-milligan deleted the eventing branch October 10, 2022 14:04
AlexsJones pushed a commit that referenced this pull request Oct 13, 2022
🤖 I have created a release *beep* *boop*
---


##
[0.2.3](v0.2.2...v0.2.3)
(2022-10-13)


### Features

* Eventing ([#187](#187))
([3f7fcd2](3f7fcd2))
* fixing informer issues
([#191](#191))
([837b0c6](837b0c6))
* only fire modify event when FeatureFlagConfiguration Generation field
has changed ([#167](#167))
([e2fc7ee](e2fc7ee))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants