This is an automated email from the ASF dual-hosted git repository.

hepin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko.git


The following commit(s) were added to refs/heads/main by this push:
     new a7a49bd24e =str Fold InHandler and OutHandler for operator 
ActorRefSource.
a7a49bd24e is described below

commit a7a49bd24ecc0af2d26694c373f3105851f9338b
Author: He-Pin <[email protected]>
AuthorDate: Sun Dec 17 15:30:49 2023 +0800

    =str Fold InHandler and OutHandler for operator ActorRefSource.
---
 .../scala/org/apache/pekko/stream/impl/ActorRefSource.scala    | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git 
a/stream/src/main/scala/org/apache/pekko/stream/impl/ActorRefSource.scala 
b/stream/src/main/scala/org/apache/pekko/stream/impl/ActorRefSource.scala
index b5555fad08..fb149827ee 100644
--- a/stream/src/main/scala/org/apache/pekko/stream/impl/ActorRefSource.scala
+++ b/stream/src/main/scala/org/apache/pekko/stream/impl/ActorRefSource.scala
@@ -47,6 +47,7 @@ private object ActorRefSource {
       inheritedAttributes: Attributes,
       eagerMaterializer: Materializer): (GraphStageLogic, ActorRef) = {
     val stage: GraphStageLogic with StageLogging with ActorRefStage = new 
GraphStageLogic(shape)
+      with OutHandler
       with StageLogging
       with ActorRefStage {
       override protected def logSource: Class[_] = classOf[ActorRefSource[_]]
@@ -155,12 +156,9 @@ private object ActorRefSource {
         }
       }
 
-      setHandler(out,
-        new OutHandler {
-          override def onPull(): Unit = {
-            tryPush()
-          }
-        })
+      override def onPull(): Unit = tryPush()
+
+      setHandler(out, this)
     }
 
     (stage, stage.ref)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to