Skip to content

Commit

Permalink
fixup! fixup! ConsistencyManager interface & implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
rgomezp committed Sep 25, 2024
1 parent c3e0632 commit bc9963b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import kotlinx.coroutines.sync.withLock
*/
class ConsistencyManager : IConsistencyManager {
private val mutex = Mutex()
private val indexedTokens: MutableMap<String, MutableMap<IConsistencyKeyEnum, String?>> = mutableMapOf()
private val indexedTokens: MutableMap<String, MutableMap<IConsistencyKeyEnum, String>> = mutableMapOf()
private val conditions: MutableList<Pair<ICondition, CompletableDeferred<String?>>> =
mutableListOf()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface ICondition {
* Define a condition that "unblocks" execution
* e.g. we have token (A && B) || A
*/
fun isMet(indexedTokens: Map<String, Map<IConsistencyKeyEnum, String?>>): Boolean
fun isMet(indexedTokens: Map<String, Map<IConsistencyKeyEnum, String>>): Boolean

/**
* Used to process tokens according to their format & return the newest token.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class ConsistencyManagerTests : FunSpec({
override val id: String
get() = ID

override fun isMet(indexedTokens: Map<String, Map<IConsistencyKeyEnum, String?>>): Boolean {
override fun isMet(indexedTokens: Map<String, Map<IConsistencyKeyEnum, String>>): Boolean {
return false // Always returns false to simulate an unmet condition
}

Expand All @@ -100,7 +100,7 @@ class ConsistencyManagerTests : FunSpec({
override val id: String
get() = ID

override fun isMet(indexedTokens: Map<String, Map<IConsistencyKeyEnum, String?>>): Boolean {
override fun isMet(indexedTokens: Map<String, Map<IConsistencyKeyEnum, String>>): Boolean {
return indexedTokens == expectedRywTokens
}

Expand Down

0 comments on commit bc9963b

Please sign in to comment.