Commit f12e483
feat(multi): add tracking, functional options (#446)
* refactor(multi): simplify API with functional options pattern
Changes:
- Add WithProvider option for registering named providers with optional hooks
- Remove ProviderMap type in favor of variadic functional options
- Change NamedProvider from struct to interface
- Update NewProvider signature to take strategy first, then options
- Add Track method support to MultiProvider for tracking events
- Update tests, documentation and examples to reflect new API
Signed-off-by: Roman Dmytrenko <[email protected]>
* address PR feedback
Signed-off-by: Roman Dmytrenko <[email protected]>
* fix the data race
Signed-off-by: Roman Dmytrenko <[email protected]>
* simplify providers' hooks
Signed-off-by: Roman Dmytrenko <[email protected]>
* improve event handling in multiprovider
- remove inboundEvents channel in favor of direct pipe channel
- fix race condition in updateProviderStateFromEvent with lock
- optimize Shutdown to only spawn goroutines for StateHandler providers
- ensure outboundEvents channel is closed after all workers complete
Signed-off-by: Roman Dmytrenko <[email protected]>
* support ContextAwareStateHandler interface
Signed-off-by: Roman Dmytrenko <[email protected]>
* address PR feedback about readme
Signed-off-by: Roman Dmytrenko <[email protected]>
* Update openfeature/multi/multiprovider.go
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Roman Dmytrenko <[email protected]>
* address PR feedback from gemini
Signed-off-by: Roman Dmytrenko <[email protected]>
* improve test coverage
Signed-off-by: Roman Dmytrenko <[email protected]>
* Update openfeature/multi/multiprovider.go
Co-authored-by: Sahid Velji <[email protected]>
Signed-off-by: Roman Dmytrenko <[email protected]>
* Update openfeature/multi/multiprovider.go
Co-authored-by: Sahid Velji <[email protected]>
Signed-off-by: Roman Dmytrenko <[email protected]>
* Update openfeature/multi/errors.go
Co-authored-by: Sahid Velji <[email protected]>
Signed-off-by: Roman Dmytrenko <[email protected]>
* address PR review
Signed-off-by: Roman Dmytrenko <[email protected]>
* address PR feedback
Signed-off-by: Roman Dmytrenko <[email protected]>
---------
Signed-off-by: Roman Dmytrenko <[email protected]>
Co-authored-by: Roman Dmytrenko <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Sahid Velji <[email protected]>1 parent 1a0d39e commit f12e483
File tree
14 files changed
+815
-429
lines changed- openfeature/multi
14 files changed
+815
-429
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
39 | 40 | | |
40 | | - | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
104 | | - | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| |||
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
143 | | - | |
| 144 | + | |
144 | 145 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
| 127 | + | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
0 commit comments