-
- All Implemented Interfaces:
-
java.io.Closeable,java.lang.AutoCloseable
public class UnleashFetcher implements Closeable
Http Client for fetching data from Unleash Proxy. By default creates an OkHttpClient with readTimeout set to 2 seconds and a cache of 10 MBs
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classUnleashFetcher.Companion
-
Constructor Summary
Constructors Constructor Description UnleashFetcher(UnleashConfig unleashConfig, OkHttpClient httpClient, StateFlow<UnleashContext> unleashContext)
-
Method Summary
Modifier and Type Method Description final <ERROR CLASS>getFeaturesReceivedFlow()final UnitstartWatchingContext()final ToggleResponserefreshToggles()Unitclose()final SharedFlow<HeartbeatEvent>getHeartbeatFlow()-
-
Constructor Detail
-
UnleashFetcher
UnleashFetcher(UnleashConfig unleashConfig, OkHttpClient httpClient, StateFlow<UnleashContext> unleashContext)
- Parameters:
httpClient-the http client to use for fetching toggles from Unleash proxy
-
-
Method Detail
-
getFeaturesReceivedFlow
final <ERROR CLASS> getFeaturesReceivedFlow()
-
startWatchingContext
final Unit startWatchingContext()
-
refreshToggles
final ToggleResponse refreshToggles()
-
getHeartbeatFlow
final SharedFlow<HeartbeatEvent> getHeartbeatFlow()
-
-
-
-