File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed
main/java/dev/openfeature/sdk/events
test/java/dev/openfeature/sdk Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class EventHandler(dispatcher: CoroutineDispatcher) :
31
31
ProviderStatus {
32
32
private val sharedFlow: MutableSharedFlow <OpenFeatureEvents > = MutableSharedFlow ()
33
33
private val currentStatus: MutableStateFlow <OpenFeatureEvents > =
34
- MutableStateFlow (OpenFeatureEvents .ProviderShutDown )
34
+ MutableStateFlow (OpenFeatureEvents .ProviderNotReady )
35
35
private val job = Job ()
36
36
private val coroutineScope = CoroutineScope (job + dispatcher)
37
37
@@ -40,7 +40,7 @@ class EventHandler(dispatcher: CoroutineDispatcher) :
40
40
sharedFlow.collect {
41
41
currentStatus.value = it
42
42
when (it) {
43
- is OpenFeatureEvents .ProviderShutDown -> {
43
+ is OpenFeatureEvents .ProviderNotReady -> {
44
44
job.cancelChildren()
45
45
}
46
46
Original file line number Diff line number Diff line change 1
1
package dev.openfeature.sdk.events
2
2
3
3
sealed interface OpenFeatureEvents {
4
+ object ProviderNotReady : OpenFeatureEvents
4
5
object ProviderReady : OpenFeatureEvents
5
6
data class ProviderError (val error : Throwable ) : OpenFeatureEvents
6
7
object ProviderStale : OpenFeatureEvents
7
- object ProviderShutDown : OpenFeatureEvents
8
8
}
Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ class EventsHandlerTest {
181
181
val eventHandler = EventHandler (dispatcher)
182
182
val provider = TestFeatureProvider (dispatcher, eventHandler)
183
183
184
- Assert .assertEquals(OpenFeatureEvents .ProviderShutDown , provider.getProviderStatus())
184
+ Assert .assertEquals(OpenFeatureEvents .ProviderNotReady , provider.getProviderStatus())
185
185
186
186
provider.emitReady()
187
187
@@ -201,6 +201,6 @@ class EventsHandlerTest {
201
201
202
202
provider.shutdown()
203
203
204
- Assert .assertEquals(OpenFeatureEvents .ProviderShutDown , provider.getProviderStatus())
204
+ Assert .assertEquals(OpenFeatureEvents .ProviderNotReady , provider.getProviderStatus())
205
205
}
206
206
}
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class TestFeatureProvider(
18
18
}
19
19
20
20
override fun shutdown () {
21
- eventHandler.publish(OpenFeatureEvents .ProviderShutDown )
21
+ eventHandler.publish(OpenFeatureEvents .ProviderNotReady )
22
22
}
23
23
24
24
override fun onContextSet (oldContext : EvaluationContext ? , newContext : EvaluationContext ) {
You can’t perform that action at this time.
0 commit comments