Interface IDataSourceUpdateSink
Interface that an implementation of IDataSource will use to push data into the SDK.
Namespace: LaunchDarkly.Sdk.Client.Subsystems
Assembly: LaunchDarkly.ClientSdk.dll
Syntax
public interface IDataSourceUpdateSink
Remarks
The data source interacts with this object, rather than manipulating the data store directly, so that the SDK can perform any other necessary operations that must happen when data is updated.
Methods
| Edit this page View SourceInit(Context, FullDataSet)
Completely overwrites the current contents of the data store with a set of items for each collection.
Declaration
void Init(Context context, DataStoreTypes.FullDataSet data)
Parameters
Type | Name | Description |
---|---|---|
Context | context | the current evaluation context |
DataStoreTypes.FullDataSet | data | the data set |
UpdateStatus(DataSourceState, ErrorInfo?)
Informs the SDK of a change in the data source's status.
Declaration
void UpdateStatus(DataSourceState newState, DataSourceStatus.ErrorInfo? newError)
Parameters
Type | Name | Description |
---|---|---|
DataSourceState | newState | the data source state |
DataSourceStatus.ErrorInfo? | newError | information about a new error, if any |
Remarks
Data source implementations should use this method if they have any concept of being in a valid state, a temporarily disconnected state, or a permanently stopped state.
If newState
is different from the previous state, and/or newError
is non-null, the SDK will start returning the new status(adding a timestamp for the change) from
Status, and will trigger status change events to any
registered listeners.
A special case is that if newState
is Interrupted,
but the previous state was Initializing, the state will
remain at Initializing because
Interrupted is only meaningful after a successful startup.
Data source implementations normally should not need to set the state to Valid, because that will happen automatically if they call Init(Context, FullDataSet).
See Also
| Edit this page View SourceUpsert(Context, string, ItemDescriptor)
Updates or inserts an item. For updates, the object will only be updated if the existing version is less than the new version.
Declaration
void Upsert(Context context, string key, DataStoreTypes.ItemDescriptor data)
Parameters
Type | Name | Description |
---|---|---|
Context | context | the current evaluation context |
string | key | the feature flag key |
DataStoreTypes.ItemDescriptor | data | the item data |