-
- All Implemented Interfaces:
-
com.onesignal.common.consistency.models.IConsistencyManager
public final class ConsistencyManager implements IConsistencyManager
Manages read-your-write tokens for more accurate segment membership calculation. Uses customizable conditions that block retrieval of the newest token until met.
Usage: val consistencyManager = ConsistencyManager<MyEnum>() val updateConditionDeferred = consistencyManager.registerCondition(MyCustomCondition()) val rywToken = updateConditionDeferred.await()
-
-
Constructor Summary
Constructors Constructor Description ConsistencyManager()
-
Method Summary
Modifier and Type Method Description UnitsetRywData(String id, IConsistencyKeyEnum key, RywData value)Set method to update the token based on the key. CompletableDeferred<RywData>getRywDataFromAwaitableCondition(ICondition condition)Register a condition with its corresponding deferred action. UnitresolveConditionsWithID(String id)Resolve all conditions with a specific ID -
-
Method Detail
-
setRywData
Unit setRywData(String id, IConsistencyKeyEnum key, RywData value)
Set method to update the token based on the key. Params: id: String - the index of the token map (e.g. onesignalId) key: K - corresponds to the operation for which we have a read-your-write token value: String? - the token (read-your-write token)
-
getRywDataFromAwaitableCondition
CompletableDeferred<RywData> getRywDataFromAwaitableCondition(ICondition condition)
Register a condition with its corresponding deferred action. Returns a deferred condition.
-
resolveConditionsWithID
Unit resolveConditionsWithID(String id)
Resolve all conditions with a specific ID
-
-
-
-