You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "sfali (via GitHub)" <gi...@apache.org> on 2024/03/15 13:31:10 UTC

[PR] Documentation for typed EventStream Fixes #1162 [incubator-pekko]

sfali opened a new pull request, #1195:
URL: https://github.com/apache/incubator-pekko/pull/1195

   (no comment)


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Documentation for typed EventStream [incubator-pekko]

Posted by "sfali (via GitHub)" <gi...@apache.org>.
sfali commented on PR #1195:
URL: https://github.com/apache/incubator-pekko/pull/1195#issuecomment-2004983809

   > Build is broken
   
   Not sure what is broken, I am able to compile locally.


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Documentation for typed EventStream [incubator-pekko]

Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on PR #1195:
URL: https://github.com/apache/incubator-pekko/pull/1195#issuecomment-2007384721

   @sfali Are you done with the commits so I can run the PR?


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Documentation for typed EventStream [incubator-pekko]

Posted by "sfali (via GitHub)" <gi...@apache.org>.
sfali commented on PR #1195:
URL: https://github.com/apache/incubator-pekko/pull/1195#issuecomment-2007588884

   Finally passed


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Documentation for typed EventStream [incubator-pekko]

Posted by "Roiocam (via GitHub)" <gi...@apache.org>.
Roiocam commented on code in PR #1195:
URL: https://github.com/apache/incubator-pekko/pull/1195#discussion_r1528323544


##########
actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/eventstream/EventStreamSuperClassDocTest.java:
##########
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pekko.actor.typed.eventstream;
+
+import org.apache.pekko.actor.testkit.typed.javadsl.ActorTestKit;
+import org.apache.pekko.actor.typed.ActorSystem;
+import org.apache.pekko.actor.typed.Behavior;
+import org.apache.pekko.actor.typed.javadsl.AbstractBehavior;
+import org.apache.pekko.actor.typed.javadsl.ActorContext;
+import org.apache.pekko.actor.typed.javadsl.Behaviors;
+import org.apache.pekko.actor.typed.javadsl.Receive;
+import org.junit.Test;
+import org.scalatestplus.junit.JUnitSuite;
+
+// #listen-to-super-class-imports
+import org.apache.pekko.actor.DeadLetter;
+import org.apache.pekko.actor.AllDeadLetters;
+import org.apache.pekko.actor.Dropped;
+import org.apache.pekko.actor.SuppressedDeadLetter;
+import org.apache.pekko.actor.UnhandledMessage;
+// #listen-to-super-class-imports
+
+public class EventStreamSuperClassDocTest extends JUnitSuite {
+
+    @Test
+    public void listenToDeadLetters() {
+        // #subscribe-to-super-class
+        ActorSystem<Command> system = ActorSystem.create(AllDeadLettersListenerBehavior.create(), "AllDeadLettersListener");
+        system.eventStream().tell(new EventStream.Subscribe<>(Command.class, system));
+        // #subscribe-to-super-class
+        ActorTestKit.shutdown(system);
+    }
+
+    // #listen-to-super-class
+    interface Command {}
+
+    static final class AllDeadLettersWrapper implements Command {
+        private final AllDeadLetters allDeadLetters;
+
+        public AllDeadLettersWrapper(AllDeadLetters deadLetter) {
+            this.allDeadLetters = deadLetter;
+        }
+
+        public AllDeadLetters getAllDeadLetters() {
+            return allDeadLetters;
+        }
+    }
+
+    static class AllDeadLettersListenerBehavior extends AbstractBehavior<Command> {
+
+        public static Behavior<Command> create() {
+            return Behaviors.setup(AllDeadLettersListenerBehavior::new);
+        }
+
+        public AllDeadLettersListenerBehavior(ActorContext<Command> context) {
+            super(context);
+        }
+
+        @Override
+        public Receive<Command> createReceive() {
+            return newReceiveBuilder().onMessage(AllDeadLettersWrapper.class, msg -> {
+                final AllDeadLetters allDeadLetters = msg.allDeadLetters;
+                final Class<? extends AllDeadLetters> klass = msg.allDeadLetters.getClass();
+                if (klass.isAssignableFrom(DeadLetter.class)) {

Review Comment:
   The actor already has done similar works on `Receive`, why do we need those type-checks on here?
   
   I don't think this programming style is something we want to share with users.
   
   In my opinion, the EventStream use case mostly was embedded Pub/Sub feature(aka EventBus), we treat the type as a Topic(e.g. `AllDeadLetters`), and the instance with subtype was the specific message(e.g. `DeadLetter`, `Dropped`, `UnhandledMessage`).
   
   Or a smaller range of channels: `DeadLetter` is used as both a topic and message instance type.
   
   In your PR, subscribing to Command doesn't make sense. When users need to publish, they should convert AllDeadLetter to AllDeadLetterWrapper. This is not the correct usage.
   
   In general, if you want this Actor to receive messages from other Actors (such as in your case), you can use Adapter, but it is actually like this:
   
   
   ```scala
    ActorSystem<Command> system = ActorSystem.create(AllDeadLettersListenerBehavior.create(), "AllDeadLettersListener");
   // get adapter ref, or do subscribe logic in actor internal.
   val adapterRef = system ? getAllDeadLettersAdapter
   // subscribe the raw type of `AllDeadLetters`, but receive with adapterRef
   system.eventStream().tell(new EventStream.Subscribe<>(AllDeadLetters.class, adapterRef));
   // and then publish look like this.
   system.eventStream().tell(new EventStream.Publish<>(DeadLetter("msg", senderRef, recipientRef)));
   
   // In your code, publish in this way, but in fact, you can't expect the producer to use the type of message that the consumer can receive. On the contrary, the consumer must adapt to the type of producer, which is very important for the ability to broadcast.
   val deadLetter = DeadLetter("msg", senderRef, recipientRef)
   system.eventStream().tell(new EventStream.Publish<>(new AllDeadLettersWrapper(deadLetter)));
   ```
   
   



-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Documentation for typed EventStream [incubator-pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #1195:
URL: https://github.com/apache/incubator-pekko/pull/1195#discussion_r1526305358


##########
actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/eventstream/EventStreamDocTest.java:
##########
@@ -0,0 +1,68 @@
+package org.apache.pekko.actor.typed.eventstream;

Review Comment:
   can you add a standard Apache header here? not the one that mentions Akka



-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Documentation for typed EventStream [incubator-pekko]

Posted by "sfali (via GitHub)" <gi...@apache.org>.
sfali commented on PR #1195:
URL: https://github.com/apache/incubator-pekko/pull/1195#issuecomment-2007595616

   > @sfali Are you done with the commits so I can run the PR's CI?
   
   Yes, I am done


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Documentation for typed EventStream [incubator-pekko]

Posted by "sfali (via GitHub)" <gi...@apache.org>.
sfali commented on code in PR #1195:
URL: https://github.com/apache/incubator-pekko/pull/1195#discussion_r1526505151


##########
actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/eventstream/EventStreamDocTest.java:
##########
@@ -0,0 +1,68 @@
+package org.apache.pekko.actor.typed.eventstream;

Review Comment:
   Added



##########
actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/eventstream/EventStreamSuperClassDocTest.java:
##########
@@ -0,0 +1,86 @@
+package org.apache.pekko.actor.typed.eventstream;

Review Comment:
   Added



-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Documentation for typed EventStream [pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning merged PR #1195:
URL: https://github.com/apache/pekko/pull/1195


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Documentation for typed EventStream [incubator-pekko]

Posted by "sfali (via GitHub)" <gi...@apache.org>.
sfali commented on code in PR #1195:
URL: https://github.com/apache/incubator-pekko/pull/1195#discussion_r1529273995


##########
actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/eventstream/EventStreamSuperClassDocTest.java:
##########
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pekko.actor.typed.eventstream;
+
+import org.apache.pekko.actor.testkit.typed.javadsl.ActorTestKit;
+import org.apache.pekko.actor.typed.ActorSystem;
+import org.apache.pekko.actor.typed.Behavior;
+import org.apache.pekko.actor.typed.javadsl.AbstractBehavior;
+import org.apache.pekko.actor.typed.javadsl.ActorContext;
+import org.apache.pekko.actor.typed.javadsl.Behaviors;
+import org.apache.pekko.actor.typed.javadsl.Receive;
+import org.junit.Test;
+import org.scalatestplus.junit.JUnitSuite;
+
+// #listen-to-super-class-imports
+import org.apache.pekko.actor.DeadLetter;
+import org.apache.pekko.actor.AllDeadLetters;
+import org.apache.pekko.actor.Dropped;
+import org.apache.pekko.actor.SuppressedDeadLetter;
+import org.apache.pekko.actor.UnhandledMessage;
+// #listen-to-super-class-imports
+
+public class EventStreamSuperClassDocTest extends JUnitSuite {
+
+    @Test
+    public void listenToDeadLetters() {
+        // #subscribe-to-super-class
+        ActorSystem<Command> system = ActorSystem.create(AllDeadLettersListenerBehavior.create(), "AllDeadLettersListener");
+        system.eventStream().tell(new EventStream.Subscribe<>(Command.class, system));
+        // #subscribe-to-super-class
+        ActorTestKit.shutdown(system);
+    }
+
+    // #listen-to-super-class
+    interface Command {}
+
+    static final class AllDeadLettersWrapper implements Command {
+        private final AllDeadLetters allDeadLetters;
+
+        public AllDeadLettersWrapper(AllDeadLetters deadLetter) {
+            this.allDeadLetters = deadLetter;
+        }
+
+        public AllDeadLetters getAllDeadLetters() {
+            return allDeadLetters;
+        }
+    }
+
+    static class AllDeadLettersListenerBehavior extends AbstractBehavior<Command> {
+
+        public static Behavior<Command> create() {
+            return Behaviors.setup(AllDeadLettersListenerBehavior::new);
+        }
+
+        public AllDeadLettersListenerBehavior(ActorContext<Command> context) {
+            super(context);
+        }
+
+        @Override
+        public Receive<Command> createReceive() {
+            return newReceiveBuilder().onMessage(AllDeadLettersWrapper.class, msg -> {
+                final AllDeadLetters allDeadLetters = msg.allDeadLetters;
+                final Class<? extends AllDeadLetters> klass = msg.allDeadLetters.getClass();
+                if (klass.isAssignableFrom(DeadLetter.class)) {

Review Comment:
   I had the missing subscription in the constructor of `AllDeadLettersListenerBehavior` and there is no need to have subscription in the client side, which is removed now. 
   
   



-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Documentation for typed EventStream [incubator-pekko]

Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on PR #1195:
URL: https://github.com/apache/incubator-pekko/pull/1195#issuecomment-2005842448

   > > Build is broken
   > 
   > Not sure what is broken, I am able to compile locally.
   
   The build for Pekko core is a bit complicated as we use different JDK's to produce different outputs. In this case its generating docs with JKD11 using JDK 9 specific classes that is causing the failure, specifically running `sbt ";+TestJdk9 / compile ; +compile:doc"` using JDK 11.
   
   Doing so produces the following error
   
   ```
   [error] /home/runner/work/incubator-pekko/incubator-pekko/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/eventstream/EventStreamDocSpec.scala:45:27: overloaded method value info with alternatives:
   [error]   (x$1: org.slf4j.Marker,x$2: String,x$3: Object*)Unit <and>
   [error]   (x$1: org.slf4j.Marker,x$2: String,x$3: Any,x$4: Any)Unit <and>
   [error]   (x$1: String,x$2: Object*)Unit
   [error]  cannot be applied to (String, String, String, Any)
   [error]               context.log.info("Dead letter received from sender ({}) to recipient ({}) with message: {}",
   [error]                           ^
   [error] /home/runner/work/incubator-pekko/incubator-pekko/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/eventstream/EventStreamDocSpec.scala:69:31: overloaded method value info with alternatives:
   [error]   (x$1: org.slf4j.Marker,x$2: String,x$3: Object*)Unit <and>
   [error]   (x$1: org.slf4j.Marker,x$2: String,x$3: Any,x$4: Any)Unit <and>
   [error]   (x$1: String,x$2: Object*)Unit
   [error]  cannot be applied to (String, String, String, Any)
   [error]                   context.log.info("DeadLetter received from sender ({}) to recipient ({}) with message: {}",
   [error]                               ^
   [error] /home/runner/work/incubator-pekko/incubator-pekko/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/eventstream/EventStreamDocSpec.scala:73:31: overloaded method value info with alternatives:
   [error]   (x$1: org.slf4j.Marker,x$2: String,x$3: Object*)Unit <and>
   [error]   (x$1: String,x$2: Object*)Unit
   [error]  cannot be applied to (String, String, String, String, Any)
   [error]                   context.log.info("Dropped: sender ({}) to recipient ({}) with message: {}, reason: {}",
   [error]                               ^
   [error] /home/runner/work/incubator-pekko/incubator-pekko/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/eventstream/EventStreamDocSpec.scala:82:31: overloaded method value info with alternatives:
   [error]   (x$1: org.slf4j.Marker,x$2: String,x$3: Object*)Unit <and>
   [error]   (x$1: org.slf4j.Marker,x$2: String,x$3: Any,x$4: Any)Unit <and>
   [error]   (x$1: String,x$2: Object*)Unit
   [error]  cannot be applied to (String, String, String, Any)
   [error]                   context.log.info("UnhandledMessage received from sender ({}) to recipient ({}) with message: {}",
   [error]                               ^
   [error] four errors found
   ```
   
   So its an issue with unresolved resolution of overloaded `log.info`


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Documentation for typed EventStream [pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #1195:
URL: https://github.com/apache/pekko/pull/1195#issuecomment-2076829016

   merged - thanks @sfali 


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Documentation for typed EventStream [incubator-pekko]

Posted by "sfali (via GitHub)" <gi...@apache.org>.
sfali commented on PR #1195:
URL: https://github.com/apache/incubator-pekko/pull/1195#issuecomment-2007485286

   > There are still issues
   > 
   > ```
   > [error] -- Error: /home/runner/work/incubator-pekko/incubator-pekko/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/eventstream/EventStreamDocSpec.scala:40:59 
   > [error] 40 |          val adapter = context.messageAdapter[DeadLetter](DeadLetterWrapper)
   > [error]    |                                                           ^^^^^^^^^^^^^^^^^
   > [error]    |The method `apply` is inserted. The auto insertion will be deprecated, please write `org.apache.pekko.actor.typed.eventstream.EventStreamDocSpec.DeadLetterListener.
   > [error]    |  DeadLetterWrapper.apply` explicitly.
   > [error] -- Error: /home/runner/work/incubator-pekko/incubator-pekko/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/eventstream/EventStreamDocSpec.scala:62:63 
   > [error] 62 |          val adapter = context.messageAdapter[AllDeadLetters](AllDeadLettersWrapper)
   > [error]    |                                                               ^^^^^^^^^^^^^^^^^^^^^
   > [error]    |The method `apply` is inserted. The auto insertion will be deprecated, please write `org.apache.pekko.actor.typed.eventstream.EventStreamDocSpec.AllDeadLetterListener
   > [error]    |  .AllDeadLettersWrapper.apply` explicitly.
   > ```
   > 
   > Just need to `.apply`
   
   Updated


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Documentation for typed EventStream [incubator-pekko]

Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on PR #1195:
URL: https://github.com/apache/incubator-pekko/pull/1195#issuecomment-2007425092

   There are still issues
   
   ```
   [error] -- Error: /home/runner/work/incubator-pekko/incubator-pekko/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/eventstream/EventStreamDocSpec.scala:40:59 
   [error] 40 |          val adapter = context.messageAdapter[DeadLetter](DeadLetterWrapper)
   [error]    |                                                           ^^^^^^^^^^^^^^^^^
   [error]    |The method `apply` is inserted. The auto insertion will be deprecated, please write `org.apache.pekko.actor.typed.eventstream.EventStreamDocSpec.DeadLetterListener.
   [error]    |  DeadLetterWrapper.apply` explicitly.
   [error] -- Error: /home/runner/work/incubator-pekko/incubator-pekko/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/eventstream/EventStreamDocSpec.scala:62:63 
   [error] 62 |          val adapter = context.messageAdapter[AllDeadLetters](AllDeadLettersWrapper)
   [error]    |                                                               ^^^^^^^^^^^^^^^^^^^^^
   [error]    |The method `apply` is inserted. The auto insertion will be deprecated, please write `org.apache.pekko.actor.typed.eventstream.EventStreamDocSpec.AllDeadLetterListener
   [error]    |  .AllDeadLettersWrapper.apply` explicitly.
   ```
   
   Just need to `.apply`


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Documentation for typed EventStream [incubator-pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #1195:
URL: https://github.com/apache/incubator-pekko/pull/1195#discussion_r1526305978


##########
actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/eventstream/EventStreamSuperClassDocTest.java:
##########
@@ -0,0 +1,86 @@
+package org.apache.pekko.actor.typed.eventstream;

Review Comment:
   likewise - all source files must have an Apache header



-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Documentation for typed EventStream [incubator-pekko]

Posted by "sfali (via GitHub)" <gi...@apache.org>.
sfali commented on code in PR #1195:
URL: https://github.com/apache/incubator-pekko/pull/1195#discussion_r1528933086


##########
actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/eventstream/EventStreamSuperClassDocTest.java:
##########
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pekko.actor.typed.eventstream;
+
+import org.apache.pekko.actor.testkit.typed.javadsl.ActorTestKit;
+import org.apache.pekko.actor.typed.ActorSystem;
+import org.apache.pekko.actor.typed.Behavior;
+import org.apache.pekko.actor.typed.javadsl.AbstractBehavior;
+import org.apache.pekko.actor.typed.javadsl.ActorContext;
+import org.apache.pekko.actor.typed.javadsl.Behaviors;
+import org.apache.pekko.actor.typed.javadsl.Receive;
+import org.junit.Test;
+import org.scalatestplus.junit.JUnitSuite;
+
+// #listen-to-super-class-imports
+import org.apache.pekko.actor.DeadLetter;
+import org.apache.pekko.actor.AllDeadLetters;
+import org.apache.pekko.actor.Dropped;
+import org.apache.pekko.actor.SuppressedDeadLetter;
+import org.apache.pekko.actor.UnhandledMessage;
+// #listen-to-super-class-imports
+
+public class EventStreamSuperClassDocTest extends JUnitSuite {
+
+    @Test
+    public void listenToDeadLetters() {
+        // #subscribe-to-super-class
+        ActorSystem<Command> system = ActorSystem.create(AllDeadLettersListenerBehavior.create(), "AllDeadLettersListener");
+        system.eventStream().tell(new EventStream.Subscribe<>(Command.class, system));
+        // #subscribe-to-super-class
+        ActorTestKit.shutdown(system);
+    }
+
+    // #listen-to-super-class
+    interface Command {}
+
+    static final class AllDeadLettersWrapper implements Command {
+        private final AllDeadLetters allDeadLetters;
+
+        public AllDeadLettersWrapper(AllDeadLetters deadLetter) {
+            this.allDeadLetters = deadLetter;
+        }
+
+        public AllDeadLetters getAllDeadLetters() {
+            return allDeadLetters;
+        }
+    }
+
+    static class AllDeadLettersListenerBehavior extends AbstractBehavior<Command> {
+
+        public static Behavior<Command> create() {
+            return Behaviors.setup(AllDeadLettersListenerBehavior::new);
+        }
+
+        public AllDeadLettersListenerBehavior(ActorContext<Command> context) {
+            super(context);
+        }
+
+        @Override
+        public Receive<Command> createReceive() {
+            return newReceiveBuilder().onMessage(AllDeadLettersWrapper.class, msg -> {
+                final AllDeadLetters allDeadLetters = msg.allDeadLetters;
+                final Class<? extends AllDeadLetters> klass = msg.allDeadLetters.getClass();
+                if (klass.isAssignableFrom(DeadLetter.class)) {

Review Comment:
   Hmm, let me take a look.



-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org