= #17342 Make 2.4 binary compatible with 2.3
(cherry picked from commit89af8bdb90) * remove final identifier in serializers i* revert/deprecate ProtobufSerializer.ARRAY_OF_BYTE_ARRAY * adding back compatible empty constructor in serializers * make FSM.State compatible * add back ActorPath.ElementRegex * revert SocketOption changes and add SocketOptionV2 seea6d3704ef6* problem filter for ActorSystem and ActorPath * problem filter for ByteString * problem filter for deprecated Timeout methods * BalancingPool companion * ask * problem filter for ActorDSL * event bus * exclude hasSubscriptions * exclude some problems in testkit * boundAddress and addressFromSocketAddress * Pool nrOfInstances * PromiseActorRef * check with 2.3.9 * migration guide note * explicit exclude of final class problems
This commit is contained in:
parent
412491d277
commit
b30e460be7
50 changed files with 1037 additions and 202 deletions
|
|
@ -72,9 +72,10 @@ trait AskSupport {
|
|||
* }}}
|
||||
*
|
||||
*/
|
||||
def ask(actorRef: ActorRef, message: Any)(implicit timeout: Timeout): Future[Any] = actorRef ? message
|
||||
def ask(actorRef: ActorRef, message: Any)(implicit timeout: Timeout): Future[Any] =
|
||||
actorRef.internalAsk(message, timeout, ActorRef.noSender)
|
||||
def ask(actorRef: ActorRef, message: Any, sender: ActorRef)(implicit timeout: Timeout): Future[Any] =
|
||||
actorRef.?(message)(timeout, sender)
|
||||
actorRef.internalAsk(message, timeout, sender)
|
||||
|
||||
/**
|
||||
* Import this implicit conversion to gain `?` and `ask` methods on
|
||||
|
|
@ -120,9 +121,24 @@ trait AskSupport {
|
|||
* }}}
|
||||
*
|
||||
*/
|
||||
def ask(actorSelection: ActorSelection, message: Any)(implicit timeout: Timeout): Future[Any] = actorSelection ? message
|
||||
def ask(actorSelection: ActorSelection, message: Any)(implicit timeout: Timeout): Future[Any] =
|
||||
actorSelection.internalAsk(message, timeout, ActorRef.noSender)
|
||||
def ask(actorSelection: ActorSelection, message: Any, sender: ActorRef)(implicit timeout: Timeout): Future[Any] =
|
||||
actorSelection.?(message)(timeout, sender)
|
||||
actorSelection.internalAsk(message, timeout, sender)
|
||||
}
|
||||
|
||||
object AskableActorRef {
|
||||
/**
|
||||
* INTERNAL API: for binary compatibility
|
||||
*/
|
||||
private[pattern] def ask$extension(actorRef: ActorRef, message: Any, timeout: Timeout): Future[Any] =
|
||||
actorRef.internalAsk(message, timeout, ActorRef.noSender)
|
||||
|
||||
/**
|
||||
* INTERNAL API: for binary compatibility
|
||||
*/
|
||||
private[pattern] def $qmark$extension(actorRef: ActorRef, message: Any, timeout: Timeout): Future[Any] =
|
||||
actorRef.internalAsk(message, timeout, ActorRef.noSender)
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -130,7 +146,28 @@ trait AskSupport {
|
|||
*/
|
||||
final class AskableActorRef(val actorRef: ActorRef) extends AnyVal {
|
||||
|
||||
def ask(message: Any)(implicit timeout: Timeout, sender: ActorRef = Actor.noSender): Future[Any] = actorRef match {
|
||||
/**
|
||||
* INTERNAL API: for binary compatibility
|
||||
*/
|
||||
protected def ask(message: Any, timeout: Timeout): Future[Any] =
|
||||
internalAsk(message, timeout, ActorRef.noSender)
|
||||
|
||||
def ask(message: Any)(implicit timeout: Timeout, sender: ActorRef = Actor.noSender): Future[Any] =
|
||||
internalAsk(message, timeout, sender)
|
||||
|
||||
/**
|
||||
* INTERNAL API: for binary compatibility
|
||||
*/
|
||||
protected def ?(message: Any)(implicit timeout: Timeout): Future[Any] =
|
||||
internalAsk(message, timeout, ActorRef.noSender)
|
||||
|
||||
def ?(message: Any)(implicit timeout: Timeout, sender: ActorRef = Actor.noSender): Future[Any] =
|
||||
internalAsk(message, timeout, sender)
|
||||
|
||||
/**
|
||||
* INTERNAL API: for binary compatibility
|
||||
*/
|
||||
private[pattern] def internalAsk(message: Any, timeout: Timeout, sender: ActorRef) = actorRef match {
|
||||
case ref: InternalActorRef if ref.isTerminated ⇒
|
||||
actorRef ! message
|
||||
Future.failed[Any](new AskTimeoutException(s"""Recipient[$actorRef] had already been terminated. Sender[$sender] sent the message of type "${message.getClass.getName}"."""))
|
||||
|
|
@ -145,7 +182,20 @@ final class AskableActorRef(val actorRef: ActorRef) extends AnyVal {
|
|||
case _ ⇒ Future.failed[Any](new IllegalArgumentException(s"""Unsupported recipient ActorRef type, question not sent to [$actorRef]. Sender[$sender] sent the message of type "${message.getClass.getName}"."""))
|
||||
}
|
||||
|
||||
def ?(message: Any)(implicit timeout: Timeout, sender: ActorRef = Actor.noSender): Future[Any] = ask(message)(timeout, sender)
|
||||
}
|
||||
|
||||
object AskableActorSelection {
|
||||
/**
|
||||
* INTERNAL API: for binary compatibility
|
||||
*/
|
||||
private[pattern] def ask$extension(actorSel: ActorSelection, message: Any, timeout: Timeout): Future[Any] =
|
||||
actorSel.internalAsk(message, timeout, ActorRef.noSender)
|
||||
|
||||
/**
|
||||
* INTERNAL API: for binary compatibility
|
||||
*/
|
||||
private[pattern] def $qmark$extension(actorSel: ActorSelection, message: Any, timeout: Timeout): Future[Any] =
|
||||
actorSel.internalAsk(message, timeout, ActorRef.noSender)
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -153,7 +203,28 @@ final class AskableActorRef(val actorRef: ActorRef) extends AnyVal {
|
|||
*/
|
||||
final class AskableActorSelection(val actorSel: ActorSelection) extends AnyVal {
|
||||
|
||||
def ask(message: Any)(implicit timeout: Timeout, sender: ActorRef = Actor.noSender): Future[Any] = actorSel.anchor match {
|
||||
/**
|
||||
* INTERNAL API: for binary compatibility
|
||||
*/
|
||||
protected def ask(message: Any, timeout: Timeout): Future[Any] =
|
||||
internalAsk(message, timeout, ActorRef.noSender)
|
||||
|
||||
def ask(message: Any)(implicit timeout: Timeout, sender: ActorRef = Actor.noSender): Future[Any] =
|
||||
internalAsk(message, timeout, sender)
|
||||
|
||||
/**
|
||||
* INTERNAL API: for binary compatibility
|
||||
*/
|
||||
protected def ?(message: Any)(implicit timeout: Timeout): Future[Any] =
|
||||
internalAsk(message, timeout, ActorRef.noSender)
|
||||
|
||||
def ?(message: Any)(implicit timeout: Timeout, sender: ActorRef = Actor.noSender): Future[Any] =
|
||||
internalAsk(message, timeout, sender)
|
||||
|
||||
/**
|
||||
* INTERNAL API: for binary compatibility
|
||||
*/
|
||||
private[pattern] def internalAsk(message: Any, timeout: Timeout, sender: ActorRef): Future[Any] = actorSel.anchor match {
|
||||
case ref: InternalActorRef ⇒
|
||||
if (timeout.duration.length <= 0)
|
||||
Future.failed[Any](
|
||||
|
|
@ -165,8 +236,6 @@ final class AskableActorSelection(val actorSel: ActorSelection) extends AnyVal {
|
|||
}
|
||||
case _ ⇒ Future.failed[Any](new IllegalArgumentException(s"""Unsupported recipient ActorRef type, question not sent to [$actorSel]. Sender[$sender] sent the message of type "${message.getClass.getName}"."""))
|
||||
}
|
||||
|
||||
def ?(message: Any)(implicit timeout: Timeout, sender: ActorRef = Actor.noSender): Future[Any] = ask(message)(timeout, sender)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -180,6 +249,9 @@ private[akka] final class PromiseActorRef private (val provider: ActorRefProvide
|
|||
import AbstractPromiseActorRef.{ stateOffset, watchedByOffset }
|
||||
import PromiseActorRef._
|
||||
|
||||
@deprecated("Use the full constructor", "2.4")
|
||||
def this(provider: ActorRefProvider, result: Promise[Any]) = this(provider, result, "unknown")
|
||||
|
||||
// This is necessary for weaving the PromiseActorRef into the asked message, i.e. the replyTo pattern.
|
||||
@volatile var messageClassName = _mcn
|
||||
|
||||
|
|
@ -344,4 +416,8 @@ private[akka] object PromiseActorRef {
|
|||
result.future onComplete { _ ⇒ try a.stop() finally f.cancel() }
|
||||
a
|
||||
}
|
||||
|
||||
@deprecated("Use apply with messageClassName and sender parameters", "2.4")
|
||||
def apply(provider: ActorRefProvider, timeout: Timeout, targetName: String): PromiseActorRef =
|
||||
apply(provider, timeout, targetName, "unknown", Actor.noSender)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue