Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,10 @@ object Behaviors {
* @param monitor The messages will also be sent to this `ActorRef`
* @param behavior The inner behavior that is decorated
*/
def monitor[T](interceptMessageClass: Class[T], monitor: ActorRef[T], behavior: Behavior[T]): Behavior[T] =
scaladsl.Behaviors.monitor(monitor, behavior)(ClassTag(interceptMessageClass))
def monitor[T](interceptMessageClass: Class[T], monitor: ActorRef[T], behavior: Behavior[T]): Behavior[T] = {
implicit val ct: ClassTag[T] = ClassTag(interceptMessageClass)
scaladsl.Behaviors.monitor(monitor, behavior)
}

/**
* Behavior decorator that logs all messages to the [[pekko.actor.typed.Behavior]] using the provided
Expand Down Expand Up @@ -332,8 +334,10 @@ object Behaviors {
def transformMessages[Outer, Inner](
interceptMessageClass: Class[Outer],
behavior: Behavior[Inner],
selector: JFunction[PFBuilder[Outer, Inner], PFBuilder[Outer, Inner]]): Behavior[Outer] =
BehaviorImpl.transformMessages(behavior, selector.apply(new PFBuilder).build())(ClassTag(interceptMessageClass))
selector: JFunction[PFBuilder[Outer, Inner], PFBuilder[Outer, Inner]]): Behavior[Outer] = {
implicit val ct: ClassTag[Outer] = ClassTag(interceptMessageClass)
BehaviorImpl.transformMessages(behavior, selector.apply(new PFBuilder).build())
}

/**
* Support for scheduled `self` messages in an actor.
Expand Down Expand Up @@ -413,7 +417,8 @@ object Behaviors {
asScalaMap(mdcForMessage.apply(message))
}

WithMdcBehaviorInterceptor[T](asScalaMap(staticMdc), mdcForMessageFun, behavior)(ClassTag(interceptMessageClass))
implicit val ct: ClassTag[T] = ClassTag(interceptMessageClass)
WithMdcBehaviorInterceptor[T](asScalaMap(staticMdc), mdcForMessageFun, behavior)
}

}
2 changes: 1 addition & 1 deletion actor/src/main/scala/org/apache/pekko/actor/FSM.scala
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ trait FSM[S, D] extends Actor with Listeners with ActorLogging {
/*
* unhandled event handler
*/
private val handleEventDefault: StateFunction = {
private def handleEventDefault: StateFunction = {
case Event(value, _) =>
log.warning("unhandled event " + value + " in state " + stateName)
stay()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ trait PersistentFSMBase[S, D, E] extends Actor with Listeners with ActorLogging
/*
* unhandled event handler
*/
private val handleEventDefault: StateFunction = {
private def handleEventDefault: StateFunction = {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will wait scala 3 fix

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we going to wait or will we log an issue to revert this when Scala team fix it?
We should link to the Scala bug.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scala/scala3#26374 @pjfanning maybe we can wait the RC2 ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's wait till scala RC2

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, have to wait, I want to make Pekko project 3.9.0 ready, then we can help capture new bugs

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I found Pekko's projects do help capture some bugs during the RC release

case Event(value, _) =>
log.warning("unhandled event " + value + " in state " + stateName)
stay()
Expand Down
4 changes: 2 additions & 2 deletions project/PekkoBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ object PekkoBuild {
"-feature",
"-unchecked",
// 'blessed' since 2.13.1
"-language:higherKinds",
"-Yfuture-lazy-vals")
"-language:higherKinds") ++
(if (CrossVersion.partialVersion(scalaVersion.value).exists(_._2 < 9)) Seq("-Yfuture-lazy-vals") else Seq.empty)
} else {
Seq(
"-encoding",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,8 @@ private[stream] object Collect {
log = logAdapter match {
case Some(l) => l
case _ =>
Logging(materializer.system, materializer)(fromMaterializer)
implicit val ls: LogSource[Materializer] = fromMaterializer
Logging(materializer.system, materializer)
}
}

Expand Down Expand Up @@ -1647,7 +1648,8 @@ private[stream] object Collect {
log = logAdapter match {
case Some(l) => l
case _ =>
Logging.withMarker(materializer.system, materializer)(fromMaterializer)
implicit val ls: LogSource[Materializer] = fromMaterializer
Logging.withMarker(materializer.system, materializer)
}
}

Expand Down