He-Pin commented on code in PR #1023:
URL: https://github.com/apache/incubator-pekko/pull/1023#discussion_r1462326576


##########
docs/src/main/java-jdk-21/docs/actors/classical/OptimizedActorWithJava21.java:
##########
@@ -0,0 +1,33 @@
+
+// #pattern-matching
+
+static class OptimizedActorWithJava21 extends UntypedAbstractActor {
+  public static class Msg1 {}
+
+  public static class Msg2 {}
+
+  public static class Msg3 {}
+
+  @Override
+  public void onReceive(Object msg) throws Exception {
+    switch(msg) {
+      case Msg1 msg -> receiveMsg1((Msg1) msg);
+      case Msg2 msg -> receiveMsg2((Msg2) msg);
+      case Msg3 msg -> receiveMsg3((Msg3) msg);
+      default _ -> unhandled(msg);
+    }
+  }
+
+  private void receiveMsg1(Msg1 msg) {
+      // actual work
+  }
+
+  private void receiveMsg2(Msg2 msg) {
+      // actual work
+  }
+
+  private void receiveMsg3(Msg3 msg) {
+      // actual work
+  }
+}
+// #pattern-matching

Review Comment:
   Please kindly change it directly please, I'm behind a firewall:)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to