Target filter
Search Kotlin docs
  • Back
  • Tealium Prism Kotlin SDK Reference
core/com.tealium.prism.core.api.network/NetworkUtilities/resourceRefresher

resourceRefresher

fun <T : DataItemConvertible> resourceRefresher(dataStore: DataStore, converter: DataItemConverter<T>, parameters: ResourceRefresher.Parameters): ResourceRefresher<T>

Creates a ResourceRefresher that will regularly fetch updated values from a remote source as specified in the given parameters.

Use the parameters to dictate how often the ResourceRefresher will refresh, and where to fetch updates from.

The refresher fetches through the shared networkHelper, which makes a single attempt per request; use the overload taking a NetworkHelper to retry failed fetches.

Parameters

dataStore

The DataStore to store the results in

converter

The DataItemConverter implementation for converting values to/from

parameters

The configuration to control the ResourceRefresher behavior


fun <T : DataItemConvertible> resourceRefresher(dataStore: DataStore, converter: DataItemConverter<T>, parameters: ResourceRefresher.Parameters, networkHelper: NetworkHelper): ResourceRefresher<T>

Creates a ResourceRefresher that will regularly fetch updated values from a remote source as specified in the given parameters, through the given networkHelper.

Use the parameters to dictate how often the ResourceRefresher will refresh, and where to fetch updates from.

To retry failed fetches, pass a helper from a derived client, e.g. from a module:

context.network.networkClient
.newClient(
listOf(
RequestInterceptors.retryWithBackoff(),
RequestInterceptors.retryWhenConnected(context.network)
)
)
.makeNetworkHelper()
Content copied to clipboard

Parameters

dataStore

The DataStore to store the results in

converter

The DataItemConverter implementation for converting values to/from

parameters

The configuration to control the ResourceRefresher behavior

networkHelper

The NetworkHelper to fetch the resource with

Generated by Dokka
(c) Tealium 2026