=act Make parameter rename safe.

This commit is contained in:
He-Pin 2023-09-24 23:07:00 +08:00 committed by kerr
parent 77a55ae4d2
commit bc9bd679a7
3 changed files with 12 additions and 5 deletions

View file

@ -63,10 +63,11 @@ private[pekko] final case class PoolRouterBuilder[T](
def withRouteeProps(routeeProps: Props): PoolRouterBuilder[T] = copy(routeeProps = routeeProps)
override def withBroadcastPredicate(pred: Predicate[T]): PoolRouter[T] =
copy(broadcastPredicate = value => pred.test(value))
override def withBroadcastPredicate(predicate: Predicate[T]): PoolRouter[T] =
copy(broadcastPredicate = value => predicate.test(value))
override def withBroadcastPredicate(pred: T => Boolean): scaladsl.PoolRouter[T] = copy(broadcastPredicate = pred)
override def withBroadcastPredicate(predicate: T => Boolean): scaladsl.PoolRouter[T] =
copy(broadcastPredicate = predicate)
}
/**

View file

@ -21,6 +21,7 @@ import pekko.actor.typed.receptionist.ServiceKey
import pekko.annotation.DoNotInherit
import java.util.function.Predicate
import scala.annotation.nowarn
object Routers {
@ -197,5 +198,6 @@ abstract class PoolRouter[T] extends DeferredBehavior[T] {
/**
* Any message that the predicate returns true for will be broadcast to all routees.
*/
def withBroadcastPredicate(pred: Predicate[T]): PoolRouter[T]
@nowarn("msg=deprecated")
def withBroadcastPredicate(@deprecatedName(Symbol("pred")) predicate: Predicate[T]): PoolRouter[T]
}

View file

@ -12,12 +12,15 @@
*/
package org.apache.pekko.actor.typed.scaladsl
import org.apache.pekko
import pekko.actor.typed.{ Behavior, Props }
import pekko.actor.typed.internal.routing.{ GroupRouterBuilder, PoolRouterBuilder }
import pekko.actor.typed.receptionist.ServiceKey
import pekko.annotation.DoNotInherit
import scala.annotation.nowarn
object Routers {
/**
@ -185,5 +188,6 @@ trait PoolRouter[T] extends Behavior[T] {
/**
* Any message that the predicate returns true for will be broadcast to all routees.
*/
def withBroadcastPredicate(predicate: T => Boolean): PoolRouter[T]
@nowarn("msg=deprecated")
def withBroadcastPredicate(@deprecatedName(Symbol("pred")) predicate: T => Boolean): PoolRouter[T]
}