From version 2.0.0
this library is based on cats-effect-3. If you want to use it with cats-effect-2,
you need to use version prior to 2.0.0
, for example, 1.0.7
Alternative to akka.cluster.sharding.ShardCoordinator.ShardAllocationStrategy
trait ShardingStrategy[F[_]] {
def allocate(requester: Region, shard: Shard, current: Allocation): F[Option[Region]]
def rebalance(current: Allocation, inProgress: Set[Shard]): F[List[Shard]]
}
val strategy = LeastShardsStrategy()
.filterShards(...)
.filterRegions(...)
.rebalanceThreshold(10)
.takeShards(10)
.shardRebalanceCooldown(1.minute)
.logging(...)
.toAllocationStrategy()
For cats-effect-3
addSbtPlugin("com.evolution" % "sbt-artifactory-plugin" % "0.0.2")
libraryDependencies += "com.evolutiongaming" %% "sharding-strategy" % "2.0.0"
For cats-effect-2
addSbtPlugin("com.evolution" % "sbt-artifactory-plugin" % "0.0.2")
libraryDependencies += "com.evolutiongaming" %% "sharding-strategy" % "1.0.7"