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

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


The following commit(s) were added to refs/heads/main by this push:
     new 323787c8a refactor: fold InHandler and OutHandler into GraphStageLogic 
in DecoderSpec (#1117)
323787c8a is described below

commit 323787c8ad371641f833bb79a6dc6e6ef3ed703f
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Sun Jul 5 03:32:36 2026 +0800

    refactor: fold InHandler and OutHandler into GraphStageLogic in DecoderSpec 
(#1117)
    
    Port akka-http commit from PR #4158: reduce object allocations in test
    DummyDecoder by folding separate InHandler/OutHandler into the
    GraphStageLogic itself using setHandlers(in, out, this).
    
    Tests:
    Not run - pure refactoring of test helper, no behavior change
    
    References:
    Refs akka/akka-http#4158
---
 .../apache/pekko/http/scaladsl/coding/DecoderSpec.scala  | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git 
a/http-tests/src/test/scala/org/apache/pekko/http/scaladsl/coding/DecoderSpec.scala
 
b/http-tests/src/test/scala/org/apache/pekko/http/scaladsl/coding/DecoderSpec.scala
index 2b6609b0d..302503f8f 100644
--- 
a/http-tests/src/test/scala/org/apache/pekko/http/scaladsl/coding/DecoderSpec.scala
+++ 
b/http-tests/src/test/scala/org/apache/pekko/http/scaladsl/coding/DecoderSpec.scala
@@ -56,16 +56,12 @@ class DecoderSpec extends AnyWordSpec with CodecSpecSupport 
{
     override def newDecompressorStage(maxBytesPerChunk: Int): () => 
GraphStage[FlowShape[ByteString, ByteString]] =
       () =>
         new SimpleLinearGraphStage[ByteString] {
-          override def createLogic(inheritedAttributes: Attributes): 
GraphStageLogic = new GraphStageLogic(shape) {
-            setHandler(in,
-              new InHandler {
-                override def onPush(): Unit = push(out, grab(in) ++ 
ByteString("compressed"))
-              })
-            setHandler(out,
-              new OutHandler {
-                override def onPull(): Unit = pull(in)
-              })
-          }
+          override def createLogic(inheritedAttributes: Attributes): 
GraphStageLogic =
+            new GraphStageLogic(shape) with InHandler with OutHandler {
+              override def onPush(): Unit = push(out, grab(in) ++ 
ByteString("compressed"))
+              override def onPull(): Unit = pull(in)
+              setHandlers(in, out, this)
+            }
         }
   }
 


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

Reply via email to