Skip to content

Commit 8a3774a

Browse files
authored
refactor: remove deprecated RepointableActorRef.isTerminated (since Akka 2.2) (#3289)
Motivation: The public isTerminated method on RepointableActorRef was deprecated since Akka 2.2 in favor of using context.watch(actor) and receiving Terminated(actor). Modification: Remove the deprecated public isTerminated method. The private[pekko] version from the ActorRef trait remains available for internal use. Result: Cleaner public API. Internal callers are unaffected as they use the private[pekko] ActorRef.isTerminated. Tests: Not run - trivial removal of long-deprecated method References: None - deprecated API cleanup
1 parent 59dadc1 commit 8a3774a

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

actor/src/main/scala/org/apache/pekko/actor/RepointableActorRef.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,14 @@ private[pekko] class RepointableActorRef(
151151

152152
def restart(cause: Throwable): Unit = underlying.restart(cause)
153153

154+
override private[pekko] def isTerminated: Boolean = underlying.isTerminated
155+
154156
def isStarted: Boolean = underlying match {
155157
case _: UnstartedCell => false
156158
case null => throw new IllegalStateException("isStarted called before initialized")
157159
case _ => true
158160
}
159161

160-
@deprecated("Use context.watch(actor) and receive Terminated(actor)", "Akka 2.2") def isTerminated: Boolean =
161-
underlying.isTerminated
162-
163162
def provider: ActorRefProvider = system.provider
164163

165164
def isLocal: Boolean = underlying.isLocal

actor/src/main/scala/org/apache/pekko/routing/RoutedActorRef.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import pekko.dispatch.MessageDispatcher
3434
* A RoutedActorRef is an ActorRef that has a set of connected ActorRef and it uses a Router to
3535
* send a message to one (or more) of these actors.
3636
*/
37-
@nowarn("msg=deprecated")
37+
@nowarn("msg=BalancingDispatcher.*deprecated")
3838
private[pekko] class RoutedActorRef(
3939
_system: ActorSystemImpl,
4040
_routerProps: Props,

actor/src/main/scala/org/apache/pekko/routing/SmallestMailbox.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ class SmallestMailboxRoutingLogic extends RoutingLogic {
9292
}
9393
}
9494

95-
// TODO should we rewrite this not to use isTerminated?
96-
@nowarn("msg=deprecated")
9795
protected def isTerminated(a: Routee): Boolean = a match {
9896
case ActorRefRoutee(ref) => ref.isTerminated
9997
case _ => false

0 commit comments

Comments
 (0)