File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
entities/src/main/scala/com/devsisters/shardcake Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -120,12 +120,15 @@ class Sharding private (
120120 stopSingletonsIfNeeded *>
121121 ZIO .logDebug(s " Unassigned shards: ${renderShardIds(shards)}" )
122122
123- private [shardcake] def isEntityOnLocalShards (recipientType : RecipientType [_], entityId : String ): UIO [Boolean ] =
123+ def getPodAddress (recipientType : RecipientType [_], entityId : String ): UIO [Option [ PodAddress ] ] =
124124 for {
125125 shards <- shardAssignments.get
126126 shardId = getShardId(recipientType, entityId)
127127 pod = shards.get(shardId)
128- } yield pod.contains(address)
128+ } yield pod
129+
130+ def isEntityOnLocalShards (recipientType : RecipientType [_], entityId : String ): UIO [Boolean ] =
131+ getPodAddress(recipientType, entityId).map(pod => pod.contains(address))
129132
130133 val getAssignments : UIO [Map [ShardId , PodAddress ]] =
131134 shardAssignments.get
You can’t perform that action at this time.
0 commit comments