[GH] (pekko): Workflow run "Build and test Pekko with Scala 3" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Build and test Pekko with Scala 3" on pekko.git has 
failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
09fb4fd29d3b7c7ee81bed8493a342aa3a3c53a3 / He-Pin 
feat: Add support for switching scheduler

Report URL: https://github.com/apache/pekko/actions/runs/12837234599

With regards,
GitHub Actions via GitBox


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



Re: [PR] chore: Make code compiles on JDK 23 [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on PR #1726:
URL: https://github.com/apache/pekko/pull/1726#issuecomment-2599233422

   @pjfanning Maybe we need to wait for the Scala 3.3.5?


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


pjfanning commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920780522


##
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupportReflect.scala:
##
@@ -0,0 +1,66 @@
+/*
+ * 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.dispatch
+
+import org.apache.pekko.annotation.InternalApi
+
+import java.util.concurrent.{ ExecutorService, ThreadFactory }
+import scala.util.control.NonFatal
+
+/**
+ * TODO remove this class once we drop Java 8 support
+ */
+@InternalApi
+private[dispatch] object VirtualThreadSupportReflect {
+
+  /**
+   * Create a virtual thread factory with given executor, the executor will be 
used as the scheduler of
+   * virtual thread.
+   *
+   * The executor should run task on platform threads.
+   *
+   * returns null if not supported.
+   */
+  def newThreadPerTaskExecutor(prefix: String, executor: ExecutorService): 
ExecutorService = {
+require(VirtualThreadSupport.isSupported, "Virtual thread is not 
supported.")
+val factory = virtualThreadFactory(prefix, executor)
+VirtualThreadSupport.newThreadPerTaskExecutor(factory)
+  }
+
+  private def virtualThreadFactory(prefix: String, executor: ExecutorService): 
ThreadFactory =
+try {
+  val builderClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder")

Review Comment:
   We've done this before - so I can't see why we can't do it again. Reflection 
means you need all those `add-opens`. MethodHandles can help to avoid that.



-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] chore: Make code compiles on JDK 23 [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on PR #1726:
URL: https://github.com/apache/pekko/pull/1726#issuecomment-2599244114

   @pjfanning I tested it with 
https://github.com/scala/scala3/releases/tag/3.3.5-RC1
   


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] chore: Make code compiles on JDK 23 [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on PR #1726:
URL: https://github.com/apache/pekko/pull/1726#issuecomment-2599246327

   @WojciechMazur I tested it with 3.3.5-RC1, but still later get:
   ```scala
   [error] 23 is not a valid choice for -java-output-version
   [info]   scalac -help  gives more information
   ```


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [I] Make code compiles on JDK 23 [pekko]

2025-01-17 Thread via GitHub


He-Pin closed issue #1725: Make code compiles on JDK 23
URL: https://github.com/apache/pekko/issues/1725


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] [DO NOT MERGE] test with scala 3.6.2 [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on PR #1722:
URL: https://github.com/apache/pekko/pull/1722#issuecomment-2599048827

   @xuwei-k Do you have some drop-in rules to support this, thanks.


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920708663


##
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupportReflect.scala:
##
@@ -0,0 +1,66 @@
+/*
+ * 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.dispatch
+
+import org.apache.pekko.annotation.InternalApi
+
+import java.util.concurrent.{ ExecutorService, ThreadFactory }
+import scala.util.control.NonFatal
+
+/**
+ * TODO remove this class once we drop Java 8 support
+ */
+@InternalApi
+private[dispatch] object VirtualThreadSupportReflect {
+
+  /**
+   * Create a virtual thread factory with given executor, the executor will be 
used as the scheduler of
+   * virtual thread.
+   *
+   * The executor should run task on platform threads.
+   *
+   * returns null if not supported.
+   */
+  def newThreadPerTaskExecutor(prefix: String, executor: ExecutorService): 
ExecutorService = {
+require(VirtualThreadSupport.isSupported, "Virtual thread is not 
supported.")
+val factory = virtualThreadFactory(prefix, executor)
+VirtualThreadSupport.newThreadPerTaskExecutor(factory)
+  }
+
+  private def virtualThreadFactory(prefix: String, executor: ExecutorService): 
ThreadFactory =
+try {
+  val builderClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder")

Review Comment:
   But Then the code seems will not compile on Java 8 without another 
reflection.



-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] chore: Make code compiles on JDK 23 [pekko]

2025-01-17 Thread via GitHub


WojciechMazur commented on PR #1726:
URL: https://github.com/apache/pekko/pull/1726#issuecomment-2599289182

   @He-Pin Thank you for spotting this bug! The JDK 23 support was backported 
to 3.3.5-RC1, by mistake 1 single change that is no longer needed in Next was 
not applied in the LTS backport. We're release 3.3.5-RC3 with a fix on Monday


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Update scalafmt-core to 3.8.4 [pekko]

2025-01-17 Thread via GitHub


He-Pin merged PR #1717:
URL: https://github.com/apache/pekko/pull/1717


-- 
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-unsubscr...@pekko.apache.org

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


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



[GH] (pekko-connectors-kafka): Workflow run "Nightly Build and Test" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Nightly Build and Test" on pekko-connectors-kafka.git 
has failed.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
baff8de74ac71ffb94d2523b40d2dfa7494cdf4e / scala-steward-asf[bot] 
<147768647+scala-steward-asf[bot]@users.noreply.github.com>
Update commons-codec to 1.17.2 (#273)

Co-authored-by: scala-steward-asf[bot] 
<147768647+scala-steward-asf[bot]@users.noreply.github.com>

Report URL: 
https://github.com/apache/pekko-connectors-kafka/actions/runs/12839967355

With regards,
GitHub Actions via GitBox


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



[GH] (pekko-management): Workflow run "Nightly Tests" is working again!

2025-01-17 Thread GitBox


The GitHub Actions job "Nightly Tests" on pekko-management.git has succeeded.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
608f749a740ae83923d57bf65b896f72a6e3f70a / scala-steward-asf[bot] 
<147768647+scala-steward-asf[bot]@users.noreply.github.com>
Update sbt-native-packager to 1.11.0 (#375)

Co-authored-by: scala-steward-asf[bot] 
<147768647+scala-steward-asf[bot]@users.noreply.github.com>

Report URL: https://github.com/apache/pekko-management/actions/runs/12839997195

With regards,
GitHub Actions via GitBox


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on PR #1724:
URL: https://github.com/apache/pekko/pull/1724#issuecomment-2599474805

   @pjfanning I took another look at vert.x, which is using reflection too, 
let's move fast and ship it as this, and then in 2.0.0, we can drop Java 8 
completely, I'm doing this in my free time, I don't like over-engineering.
   
   Especially with the current problem of 
https://github.com/apache/pekko/issues/1729, so It can only be tested in a 
separate cycle.
   
   I will leave it as it is now, I vote for shipping it as it is in 1.2.0 and 
then we move to Java 11 in 2.0.x, btw, there are many reflections in the 
current codebase too.
   


-- 
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-unsubscr...@pekko.apache.org

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


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



[I] Drop Java 8 support [pekko]

2025-01-17 Thread via GitHub


He-Pin opened a new issue, #1730:
URL: https://github.com/apache/pekko/issues/1730

   Much pain on Java 8


-- 
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-unsubscr...@pekko.apache.org.apache.org

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


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



[GH] (pekko-connectors): Workflow run "Nightly Pekko 1.0 Builds" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Nightly Pekko 1.0 Builds" on pekko-connectors.git has 
failed.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
f4fb43fb48ef54aa0d9914e88d6d4c9198df26b4 / PJ Fanning 

increase build memory (#943)

* increase build memory

* Update .jvmopts

Report URL: https://github.com/apache/pekko-connectors/actions/runs/12840293618

With regards,
GitHub Actions via GitBox


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



Re: [PR] POC: chore: use Hub [pekko]

2025-01-17 Thread via GitHub


He-Pin closed pull request #1705: POC: chore: use Hub
URL: https://github.com/apache/pekko/pull/1705


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Update sbt-scalafmt to 2.5.3 [pekko]

2025-01-17 Thread via GitHub


He-Pin closed pull request #1716: Update sbt-scalafmt to 2.5.3
URL: https://github.com/apache/pekko/pull/1716


-- 
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-unsubscr...@pekko.apache.org

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


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



[PR] chore: update scalafmt to 3.8.5 [pekko]

2025-01-17 Thread via GitHub


He-Pin opened a new pull request, #1731:
URL: https://github.com/apache/pekko/pull/1731

   Motivation:
   update scalafmt to 3.8.5
   
   refs: https://github.com/apache/pekko/pull/1716


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Add overridden duration timeout to StreamTestKit [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on code in PR #1468:
URL: https://github.com/apache/pekko/pull/1468#discussion_r1920936961


##
stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/scaladsl/StreamTestKit.scala:
##
@@ -53,10 +71,15 @@ object StreamTestKit {
   }
 
   /** INTERNAL API */
-  @InternalApi private[testkit] def assertNoChildren(sys: ActorSystem, 
supervisor: ActorRef): Unit = {
+  @InternalApi private[testkit] def assertNoChildren(sys: ActorSystem, 
supervisor: ActorRef,

Review Comment:
   add an overloaded method here to avoid the mima issue?



-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [I] META-INF/LICENSE and META-INF/NOTICE are not consistently added to jars [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on issue #1470:
URL: https://github.com/apache/pekko/issues/1470#issuecomment-2599491257

   Maybe be the SBT assembly problem?


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] [DO NOT MERGE] test with scala 3.6.2 [pekko]

2025-01-17 Thread via GitHub


pjfanning commented on PR #1722:
URL: https://github.com/apache/pekko/pull/1722#issuecomment-2599063536

   > IIRC, we need to use `?` instead of `[_]` in type parameter
   
   So far, this is not causing us an issue. We still support Scala 2.12 builds, 
so we can't make massive code changes. We can make some small changes if they 
help us getter closer to Scala 3.6 support.
   
   If it comes to making large PRs, then I think we need to abandon this until 
we start Pekko 2.0.0 work.


-- 
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-unsubscr...@pekko.apache.org

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


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



[GH] (pekko): Workflow run "Binary Compatibility" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Binary Compatibility" on pekko.git has failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
b78e373ee897a97126a98710e95cd7613b768c96 / He-Pin 
feat: Add support for switching scheduler

Report URL: https://github.com/apache/pekko/actions/runs/12835434263

With regards,
GitHub Actions via GitBox


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on PR #1724:
URL: https://github.com/apache/pekko/pull/1724#issuecomment-2599123257

   `case ThreadPoolConfig` is nowhere.


-- 
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-unsubscr...@pekko.apache.org

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


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



[GH] (pekko): Workflow run "Build and test Pekko with Scala 3" is working again!

2025-01-17 Thread GitBox


The GitHub Actions job "Build and test Pekko with Scala 3" on pekko.git has 
succeeded.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
324634ee8fe774011215885e8427ce57855eff7f / He-Pin 
chore: Make code compiles on JDK 23

Report URL: https://github.com/apache/pekko/actions/runs/1283517

With regards,
GitHub Actions via GitBox


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



[PR] chore: Make code compiles on JDK 23 [pekko]

2025-01-17 Thread via GitHub


He-Pin opened a new pull request, #1726:
URL: https://github.com/apache/pekko/pull/1726

   Motivation:
   Make code compiles on JDK 23
   refs: https://github.com/apache/pekko/issues/1725
   
   Modification:
   Add @nowarn("cat=deprecation")
   
   Result:
   Tested locally, it compiles 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-unsubscr...@pekko.apache.org

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


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



Re: [I] Make code compiles on JDK 23 [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on issue #1725:
URL: https://github.com/apache/pekko/issues/1725#issuecomment-2599091775

   @pjfanning I think it works


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


pjfanning commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920656483


##
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupportReflect.scala:
##
@@ -0,0 +1,66 @@
+/*
+ * 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.dispatch
+
+import org.apache.pekko.annotation.InternalApi
+
+import java.util.concurrent.{ ExecutorService, ThreadFactory }
+import scala.util.control.NonFatal
+
+/**
+ * TODO remove this class once we drop Java 8 support
+ */
+@InternalApi
+private[dispatch] object VirtualThreadSupportReflect {
+
+  /**
+   * Create a virtual thread factory with given executor, the executor will be 
used as the scheduler of
+   * virtual thread.
+   *
+   * The executor should run task on platform threads.
+   *
+   * returns null if not supported.
+   */
+  def newThreadPerTaskExecutor(prefix: String, executor: ExecutorService): 
ExecutorService = {
+require(VirtualThreadSupport.isSupported, "Virtual thread is not 
supported.")
+val factory = virtualThreadFactory(prefix, executor)
+VirtualThreadSupport.newThreadPerTaskExecutor(factory)
+  }
+
+  private def virtualThreadFactory(prefix: String, executor: ExecutorService): 
ThreadFactory =
+try {
+  val builderClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder")

Review Comment:
   we support adding code that compiles in Java 9-11 - see 
https://github.com/apache/pekko/blob/main/actor/src/main/scala-jdk-9/org/apache/pekko/dispatch/PekkoJdk9ForkJoinPool.scala
   
   We release using Java 11 at the moment - so if the code compiles with Java 
11, we can use it. The main source code that needs to build with Java 8, that 
can call our extra src/main/scala-jdk-9 classes using MethodHandles or 
reflection.



-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920848176


##
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupportReflect.scala:
##
@@ -0,0 +1,66 @@
+/*
+ * 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.dispatch
+
+import org.apache.pekko.annotation.InternalApi
+
+import java.util.concurrent.{ ExecutorService, ThreadFactory }
+import scala.util.control.NonFatal
+
+/**
+ * TODO remove this class once we drop Java 8 support
+ */
+@InternalApi
+private[dispatch] object VirtualThreadSupportReflect {
+
+  /**
+   * Create a virtual thread factory with given executor, the executor will be 
used as the scheduler of
+   * virtual thread.
+   *
+   * The executor should run task on platform threads.
+   *
+   * returns null if not supported.
+   */
+  def newThreadPerTaskExecutor(prefix: String, executor: ExecutorService): 
ExecutorService = {
+require(VirtualThreadSupport.isSupported, "Virtual thread is not 
supported.")
+val factory = virtualThreadFactory(prefix, executor)
+VirtualThreadSupport.newThreadPerTaskExecutor(factory)
+  }
+
+  private def virtualThreadFactory(prefix: String, executor: ExecutorService): 
ThreadFactory =
+try {
+  val builderClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder")

Review Comment:
   @pjfanning @raboof Feel free to take care of this PR, I can live with the 
add opens, I hate Java 8.



-- 
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-unsubscr...@pekko.apache.org

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


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



[I] failed: org.apache.pekko.actor.dispatch.DispatcherActorSpec [pekko]

2025-01-17 Thread via GitHub


He-Pin opened a new issue, #1727:
URL: https://github.com/apache/pekko/issues/1727

   refs: 
https://github.com/apache/pekko/actions/runs/12837234599/job/35800491988?pr=1724#step:7:5795
   
   ```scala
   01-17 21:46:48.292] [info] - must respect the throughput setting *** FAILED 
*** (10 seconds, 46 milliseconds)
   [01-17 21:46:48.292] [info]   
DispatcherActorSpec.this.convertToCheckingEqualizer[scala.Long](latch.getCount()).===[scala.Long](0L)(DispatcherActorSpec.this.typeCheckedConstraint[scala.Long,
 scala.Long](org.scalactic.Equivalence.default[scala.Long], 
scala.<:<.refl[scala.Long])) was false (DispatcherActorSpec.scala:111)
   [01-17 21:46:48.293] [info]   org.scalatest.exceptions.TestFailedException:
   [01-17 21:46:48.293] [info]   at 
org.scalatest.Assertions.newAssertionFailedException(Assertions.scala:476)
   [01-17 21:46:48.293] [info]   at 
org.scalatest.Assertions.newAssertionFailedException$(Assertions.scala:421)
   [01-17 21:46:48.293] [info]   at 
org.scalatest.Assertions$.newAssertionFailedException(Assertions.scala:1385)
   [01-17 21:46:48.293] [info]   at 
org.scalatest.Assertions$AssertionsHelper.macroAssert(Assertions.scala:1460)
   [01-17 21:46:48.293] [info]   at 
org.apache.pekko.actor.dispatch.DispatcherActorSpec.f$proxy3$1(DispatcherActorSpec.scala:111)
   [01-17 21:46:48.293] [info]   at 
org.apache.pekko.actor.dispatch.DispatcherActorSpec.$init$$$anonfun$1$$anonfun$3(DispatcherActorSpec.scala:86)
   [01-17 21:46:48.295] [info]   at 
org.scalatest.Transformer.apply$$anonfun$1(Transformer.scala:22)
   [01-17 21:46:48.295] [info]   at 
org.scalatest.OutcomeOf.outcomeOf(OutcomeOf.scala:85)
   [01-17 21:46:48.295] [info]   at 
org.scalatest.OutcomeOf.outcomeOf$(OutcomeOf.scala:31)
   [01-17 21:46:48.295] [info]   at 
org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
   [01-17 21:46:48.295] [info]   at 
org.scalatest.Transformer.apply(Transformer.scala:22)
   [01-17 21:46:48.296] [info]   at 
org.scalatest.Transformer.apply(Transformer.scala:21)
   [01-17 21:46:48.296] [info]   at 
org.scalatest.wordspec.AnyWordSpecLike$$anon$3.apply(AnyWordSpecLike.scala:1118)
   [01-17 21:46:48.296] [info]   at 
org.scalatest.TestSuite.withFixture(TestSuite.scala:196)
   [01-17 21:46:48.296] [info]   at 
org.scalatest.TestSuite.withFixture$(TestSuite.scala:138)
   [01-17 21:46:48.296] [info]   at 
org.apache.pekko.testkit.PekkoSpec.withFixture(PekkoSpec.scala:80)
   [01-17 21:46:48.296] [info]   at 
org.scalatest.wordspec.AnyWordSpecLike.invokeWithFixture$1(AnyWordSpecLike.scala:1124)
   [01-17 21:46:48.296] [info]   at 
org.scalatest.wordspec.AnyWordSpecLike.runTest$$anonfun$1(AnyWordSpecLike.scala:1128)
   [01-17 21:46:48.296] [info]   at 
org.scalatest.SuperEngine.runTestImpl(Engine.scala:306)
   [01-17 21:46:48.296] [info]   at 
org.scalatest.wordspec.AnyWordSpecLike.runTest(AnyWordSpecLike.scala:1128)
   [01-17 21:46:48.296] [info]   at 
org.scalatest.wordspec.AnyWordSpecLike.runTest$(AnyWordSpecLike.scala:44)
   [01-17 21:46:48.296] [info]   at 
org.apache.pekko.testkit.PekkoSpec.runTest(PekkoSpec.scala:80)
   [01-17 21:46:48.296] [info]   at 
org.scalatest.wordspec.AnyWordSpecLike.runTests$$anonfun$1(AnyWordSpecLike.scala:1187)
   [01-17 21:46:48.296] [info]   at 
org.scalatest.SuperEngine.traverseSubNodes$1$$anonfun$1(Engine.scala:413)
   [01-17 21:46:48.296] [info]   at 
scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
   [01-17 21:46:48.296] [info]   at 
scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
   [01-17 21:46:48.296] [info]   at 
scala.collection.immutable.List.foreach(List.scala:334)
   [01-17 21:46:48.296] [info]   at 
org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:429)
   [01-17 21:46:48.296] [info]   at 
org.scalatest.SuperEngine.runTestsInBranch(Engine.scala:390)
   [01-17 21:46:48.297] [info]   at 
org.scalatest.SuperEngine.traverseSubNodes$1$$anonfun$1(Engine.scala:427)
   [01-17 21:46:48.297] [info]   at 
scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
   [01-17 21:46:48.297] [info]   at 
scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
   [01-17 21:46:48.297] [info]   at 
scala.collection.immutable.List.foreach(List.scala:334)
   [01-17 21:46:48.297] [info]   at 
org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:429)
   [01-17 21:46:48.297] [info]   at 
org.scalatest.SuperEngine.runTestsInBranch(Engine.scala:396)
   [01-17 21:46:48.297] [info]   at 
org.scalatest.SuperEngine.runTestsImpl(Engine.scala:475)
   [01-17 21:46:48.297] [info]   at 
org.scalatest.wordspec.AnyWordSpecLike.runTests(AnyWordSpecLike.scala:1187)
   [01-17 21:46:48.297] [info]   at 
org.scalatest.wordspec.AnyWordSpecLike.runTests$(AnyWordSpecLike.scala:44)
   [01-17 21:46:48.297] [info]   at 
org.apache.pekko.testkit.PekkoSpec.runTests(PekkoSpec.scala:80)
   [01-17 21:46:48.297] [info]   at org.scalatest.Suite.run(Suite.scala:1114)
   [01-17 21:46:48.297] [info]   at org.scalatest.Suite.run$(Suite.scala:564)
   [01-1

[GH] (pekko): Workflow run "Nightly Builds" is working again!

2025-01-17 Thread GitBox


The GitHub Actions job "Nightly Builds" on pekko.git has succeeded.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
a75bc7a772f96af4aa29dba521f766bbc9fb150d / He-Pin(kerr) 
chore: Make code compiles on JDK 23 (#1726)

Report URL: https://github.com/apache/pekko/actions/runs/12838926562

With regards,
GitHub Actions via GitBox


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



[GH] (pekko-projection): Workflow run "Nightly Integration Tests for JDBC (Pekko 1.0.x)" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Nightly Integration Tests for JDBC (Pekko 1.0.x)" on 
pekko-projection.git has failed.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
24f9be389b48dcb7e1ad369b538d3121e0e9cf49 / PJ Fanning 

pekko-connectors 1.1.0 (#244)

Report URL: https://github.com/apache/pekko-projection/actions/runs/12839618373

With regards,
GitHub Actions via GitBox


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920924007


##
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupportReflect.scala:
##
@@ -0,0 +1,66 @@
+/*
+ * 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.dispatch
+
+import org.apache.pekko.annotation.InternalApi
+
+import java.util.concurrent.{ ExecutorService, ThreadFactory }
+import scala.util.control.NonFatal
+
+/**
+ * TODO remove this class once we drop Java 8 support
+ */
+@InternalApi
+private[dispatch] object VirtualThreadSupportReflect {
+
+  /**
+   * Create a virtual thread factory with given executor, the executor will be 
used as the scheduler of
+   * virtual thread.
+   *
+   * The executor should run task on platform threads.
+   *
+   * returns null if not supported.
+   */
+  def newThreadPerTaskExecutor(prefix: String, executor: ExecutorService): 
ExecutorService = {
+require(VirtualThreadSupport.isSupported, "Virtual thread is not 
supported.")
+val factory = virtualThreadFactory(prefix, executor)
+VirtualThreadSupport.newThreadPerTaskExecutor(factory)
+  }
+
+  private def virtualThreadFactory(prefix: String, executor: ExecutorService): 
ThreadFactory =
+try {
+  val builderClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder")

Review Comment:
   reported in : refs: https://github.com/apache/pekko/issues/1729



-- 
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-unsubscr...@pekko.apache.org

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


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



[I] Build Bug: org.apache.pekko.dispatch.PekkoJdk9ForkJoinPool is not on the classpath [pekko]

2025-01-17 Thread via GitHub


He-Pin opened a new issue, #1729:
URL: https://github.com/apache/pekko/issues/1729

   Even the PekkoJdk9ForkJoinPool is on the final result jar, but it does not 
on the classpath.
   
   How to reproduce:
   1. using Java 21
   2. sbt console
   3.
   ```scala
   scala> classOf[org.apache.pekko.dispatch.PekkoJdk9ForkJoinPool]
^
  error: type PekkoJdk9ForkJoinPool is not a member of package 
org.apache.pekko.dispatch
   
   scala> 
   ```
   
   I think that's maybe caused by of the `Jdk9.scala`


-- 
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-unsubscr...@pekko.apache.org.apache.org

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


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



[GH] (pekko): Workflow run "Build and test Pekko with Scala 3" is working again!

2025-01-17 Thread GitBox


The GitHub Actions job "Build and test Pekko with Scala 3" on pekko.git has 
succeeded.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
a75bc7a772f96af4aa29dba521f766bbc9fb150d / He-Pin(kerr) 
chore: Make code compiles on JDK 23 (#1726)

Report URL: https://github.com/apache/pekko/actions/runs/12838908972

With regards,
GitHub Actions via GitBox


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



[PR] chore: Proper test virtual thread dispatcher and update doc. [pekko]

2025-01-17 Thread via GitHub


He-Pin opened a new pull request, #1728:
URL: https://github.com/apache/pekko/pull/1728

   Motivation:
   Test the actor is running on virtual threads.
   


-- 
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-unsubscr...@pekko.apache.org

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


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



[GH] (pekko-persistence-jdbc): Workflow run "Publish Nightly" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Publish Nightly" on pekko-persistence-jdbc.git has 
failed.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
ceb457a61a8d0bed05f8e8b967f41220f69f0672 / PJ Fanning 

pekko 1.1.3 (#257)

Report URL: 
https://github.com/apache/pekko-persistence-jdbc/actions/runs/12839106872

With regards,
GitHub Actions via GitBox


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



[GH] (pekko): Workflow run "Build and test Pekko with Scala 3" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Build and test Pekko with Scala 3" on pekko.git has 
failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
1f386f6548cf80f2035b3488d287670b7e0676b3 / He-Pin 
feat: Add support for switching scheduler

Report URL: https://github.com/apache/pekko/actions/runs/12838563186

With regards,
GitHub Actions via GitBox


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



[GH] (pekko-persistence-jdbc): Workflow run "Publish 1.0 Nightly" is working again!

2025-01-17 Thread GitBox


The GitHub Actions job "Publish 1.0 Nightly" on pekko-persistence-jdbc.git has 
succeeded.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
ceb457a61a8d0bed05f8e8b967f41220f69f0672 / PJ Fanning 

pekko 1.1.3 (#257)

Report URL: 
https://github.com/apache/pekko-persistence-jdbc/actions/runs/12839094676

With regards,
GitHub Actions via GitBox


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



[GH] (pekko): Workflow run "Binary Compatibility" is working again!

2025-01-17 Thread GitBox


The GitHub Actions job "Binary Compatibility" on pekko.git has succeeded.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
324634ee8fe774011215885e8427ce57855eff7f / He-Pin 
chore: Make code compiles on JDK 23

Report URL: https://github.com/apache/pekko/actions/runs/1283508

With regards,
GitHub Actions via GitBox


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



Re: [PR] chore: Make code compiles on JDK 23 [pekko]

2025-01-17 Thread via GitHub


pjfanning commented on PR #1726:
URL: https://github.com/apache/pekko/pull/1726#issuecomment-2599183165

   I got this in the java 23 with scala 3 build
   
   ```
   [01-17 20:08:03.894] [info] compiling 1 Scala source to 
/home/runner/work/pekko/pekko/actor/target/scala-3.3.4/CompileJdk9-classes ...
   [01-17 20:08:03.905] [error] 23 is not a valid choice for 
-java-output-version
   [01-17 20:08:03.906] [info]   scalac -help  gives more information
   [01-17 20:08:03.906] [error] one error found
   ```


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] chore: Make code compiles on JDK 23 [pekko]

2025-01-17 Thread via GitHub


He-Pin merged PR #1726:
URL: https://github.com/apache/pekko/pull/1726


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920789689


##
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupportReflect.scala:
##
@@ -0,0 +1,66 @@
+/*
+ * 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.dispatch
+
+import org.apache.pekko.annotation.InternalApi
+
+import java.util.concurrent.{ ExecutorService, ThreadFactory }
+import scala.util.control.NonFatal
+
+/**
+ * TODO remove this class once we drop Java 8 support
+ */
+@InternalApi
+private[dispatch] object VirtualThreadSupportReflect {
+
+  /**
+   * Create a virtual thread factory with given executor, the executor will be 
used as the scheduler of
+   * virtual thread.
+   *
+   * The executor should run task on platform threads.
+   *
+   * returns null if not supported.
+   */
+  def newThreadPerTaskExecutor(prefix: String, executor: ExecutorService): 
ExecutorService = {
+require(VirtualThreadSupport.isSupported, "Virtual thread is not 
supported.")
+val factory = virtualThreadFactory(prefix, executor)
+VirtualThreadSupport.newThreadPerTaskExecutor(factory)
+  }
+
+  private def virtualThreadFactory(prefix: String, executor: ExecutorService): 
ThreadFactory =
+try {
+  val builderClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder")

Review Comment:
   Would you like help me to push this further, thanks.



-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] chore: Make code compiles on JDK 23 [pekko]

2025-01-17 Thread via GitHub


WojciechMazur commented on PR #1726:
URL: https://github.com/apache/pekko/pull/1726#issuecomment-2599367404

   Correct, it was going to be announced on Monday, becouse we're waiting for 
tooling confirmation


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on PR #1724:
URL: https://github.com/apache/pekko/pull/1724#issuecomment-2599363194

   refs: https://github.com/apache/pekko/issues/1727
   Still not know why


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on PR #1724:
URL: https://github.com/apache/pekko/pull/1724#issuecomment-2599386793

   I will split this pr to move faster.


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] [EXPERIMENT] test with java 23 [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on PR #1534:
URL: https://github.com/apache/pekko/pull/1534#issuecomment-2599075295

   I'm working on this, I think we should test the latest JDK too.


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


pjfanning commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920657670


##
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupportReflect.scala:
##
@@ -0,0 +1,66 @@
+/*
+ * 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.dispatch
+
+import org.apache.pekko.annotation.InternalApi
+
+import java.util.concurrent.{ ExecutorService, ThreadFactory }
+import scala.util.control.NonFatal
+
+/**
+ * TODO remove this class once we drop Java 8 support
+ */
+@InternalApi
+private[dispatch] object VirtualThreadSupportReflect {
+
+  /**
+   * Create a virtual thread factory with given executor, the executor will be 
used as the scheduler of
+   * virtual thread.
+   *
+   * The executor should run task on platform threads.
+   *
+   * returns null if not supported.
+   */
+  def newThreadPerTaskExecutor(prefix: String, executor: ExecutorService): 
ExecutorService = {
+require(VirtualThreadSupport.isSupported, "Virtual thread is not 
supported.")
+val factory = virtualThreadFactory(prefix, executor)
+VirtualThreadSupport.newThreadPerTaskExecutor(factory)
+  }
+
+  private def virtualThreadFactory(prefix: String, executor: ExecutorService): 
ThreadFactory =
+try {
+  val builderClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder")

Review Comment:
   
https://github.com/apache/pekko/blob/b20ec825fc2ba1782466c95489f612a5fdb76ffe/actor/src/main/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfigurator.scala#L99-L114



-- 
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-unsubscr...@pekko.apache.org

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


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



[GH] (pekko): Workflow run "Build and test Pekko with Scala 3" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Build and test Pekko with Scala 3" on pekko.git has 
failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
b78e373ee897a97126a98710e95cd7613b768c96 / He-Pin 
feat: Add support for switching scheduler

Report URL: https://github.com/apache/pekko/actions/runs/12835434256

With regards,
GitHub Actions via GitBox


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920700230


##
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupportReflect.scala:
##
@@ -0,0 +1,66 @@
+/*
+ * 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.dispatch
+
+import org.apache.pekko.annotation.InternalApi
+
+import java.util.concurrent.{ ExecutorService, ThreadFactory }
+import scala.util.control.NonFatal
+
+/**
+ * TODO remove this class once we drop Java 8 support
+ */
+@InternalApi
+private[dispatch] object VirtualThreadSupportReflect {
+
+  /**
+   * Create a virtual thread factory with given executor, the executor will be 
used as the scheduler of
+   * virtual thread.
+   *
+   * The executor should run task on platform threads.
+   *
+   * returns null if not supported.
+   */
+  def newThreadPerTaskExecutor(prefix: String, executor: ExecutorService): 
ExecutorService = {
+require(VirtualThreadSupport.isSupported, "Virtual thread is not 
supported.")
+val factory = virtualThreadFactory(prefix, executor)
+VirtualThreadSupport.newThreadPerTaskExecutor(factory)
+  }
+
+  private def virtualThreadFactory(prefix: String, executor: ExecutorService): 
ThreadFactory =
+try {
+  val builderClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder")

Review Comment:
   Let's me try.



-- 
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-unsubscr...@pekko.apache.org

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


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



[GH] (pekko): Workflow run "Nightly Builds" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Nightly Builds" on pekko.git has failed.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
72bb82e989062e1d4c59e9cb1ca7e63288b9af0b / He-Pin 
chore: Make code compiles on JDK 23

Report URL: https://github.com/apache/pekko/actions/runs/12836052025

With regards,
GitHub Actions via GitBox


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



Re: [PR] [DO NOT MERGE] test with scala 3.6.2 [pekko]

2025-01-17 Thread via GitHub


xuwei-k commented on PR #1722:
URL: https://github.com/apache/pekko/pull/1722#issuecomment-2599305898

   - https://github.com/typelevel/cats-effect/pull/4236
   - https://github.com/scala/scala/pull/10005
   
   scalafmt support rewrite `[_]` to `[?]`.
   
   latest Scala 2.12.x and 2.13.x support new wildcard syntax.
   


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920793244


##
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupportReflect.scala:
##
@@ -0,0 +1,66 @@
+/*
+ * 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.dispatch
+
+import org.apache.pekko.annotation.InternalApi
+
+import java.util.concurrent.{ ExecutorService, ThreadFactory }
+import scala.util.control.NonFatal
+
+/**
+ * TODO remove this class once we drop Java 8 support
+ */
+@InternalApi
+private[dispatch] object VirtualThreadSupportReflect {
+
+  /**
+   * Create a virtual thread factory with given executor, the executor will be 
used as the scheduler of
+   * virtual thread.
+   *
+   * The executor should run task on platform threads.
+   *
+   * returns null if not supported.
+   */
+  def newThreadPerTaskExecutor(prefix: String, executor: ExecutorService): 
ExecutorService = {
+require(VirtualThreadSupport.isSupported, "Virtual thread is not 
supported.")
+val factory = virtualThreadFactory(prefix, executor)
+VirtualThreadSupport.newThreadPerTaskExecutor(factory)
+  }
+
+  private def virtualThreadFactory(prefix: String, executor: ExecutorService): 
ThreadFactory =
+try {
+  val builderClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder")

Review Comment:
   I think I have some issues with the current setup.
   ```scala
 def newThreadPerTaskExecutor(prefix: String, executor: ExecutorService): 
ExecutorService = {
   Class.forName("org.apache.pekko.dispatch.PekkoJdk9ForkJoinPool")
   require(isSupported, "Virtual thread is not supported.")
   val factory = virtualThreadFactory(prefix, executor)
   newThreadPerTaskExecutor(factory)
 }
   ```
   and when I run:
   ```
   TestJdk9 / testOnly org.apache.pekko.dispatch.*
   ```
   gives me 
   ```scala
   g.apache.pekko.dispatch.PekkoJdk9ForkJoinPool
   java.lang.ClassNotFoundException: 
org.apache.pekko.dispatch.PekkoJdk9ForkJoinPool
at 
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at 
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:528)
at java.base/java.lang.Class.forName0(Native Method)
   ```
   
   



-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920793244


##
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupportReflect.scala:
##
@@ -0,0 +1,66 @@
+/*
+ * 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.dispatch
+
+import org.apache.pekko.annotation.InternalApi
+
+import java.util.concurrent.{ ExecutorService, ThreadFactory }
+import scala.util.control.NonFatal
+
+/**
+ * TODO remove this class once we drop Java 8 support
+ */
+@InternalApi
+private[dispatch] object VirtualThreadSupportReflect {
+
+  /**
+   * Create a virtual thread factory with given executor, the executor will be 
used as the scheduler of
+   * virtual thread.
+   *
+   * The executor should run task on platform threads.
+   *
+   * returns null if not supported.
+   */
+  def newThreadPerTaskExecutor(prefix: String, executor: ExecutorService): 
ExecutorService = {
+require(VirtualThreadSupport.isSupported, "Virtual thread is not 
supported.")
+val factory = virtualThreadFactory(prefix, executor)
+VirtualThreadSupport.newThreadPerTaskExecutor(factory)
+  }
+
+  private def virtualThreadFactory(prefix: String, executor: ExecutorService): 
ThreadFactory =
+try {
+  val builderClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder")

Review Comment:
   I think I have some issues with the current setup.
   ```scala
 def newThreadPerTaskExecutor(prefix: String, executor: ExecutorService): 
ExecutorService = {
   Class.forName("org.apache.pekko.dispatch.PekkoJdk9ForkJoinPool")
   require(isSupported, "Virtual thread is not supported.")
   val factory = virtualThreadFactory(prefix, executor)
   newThreadPerTaskExecutor(factory)
 }
   ```
   
   gives me 
   ```scala
   g.apache.pekko.dispatch.PekkoJdk9ForkJoinPool
   java.lang.ClassNotFoundException: 
org.apache.pekko.dispatch.PekkoJdk9ForkJoinPool
at 
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at 
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:528)
at java.base/java.lang.Class.forName0(Native Method)
   ```
   
   



-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920845585


##
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupportReflect.scala:
##
@@ -0,0 +1,66 @@
+/*
+ * 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.dispatch
+
+import org.apache.pekko.annotation.InternalApi
+
+import java.util.concurrent.{ ExecutorService, ThreadFactory }
+import scala.util.control.NonFatal
+
+/**
+ * TODO remove this class once we drop Java 8 support
+ */
+@InternalApi
+private[dispatch] object VirtualThreadSupportReflect {
+
+  /**
+   * Create a virtual thread factory with given executor, the executor will be 
used as the scheduler of
+   * virtual thread.
+   *
+   * The executor should run task on platform threads.
+   *
+   * returns null if not supported.
+   */
+  def newThreadPerTaskExecutor(prefix: String, executor: ExecutorService): 
ExecutorService = {
+require(VirtualThreadSupport.isSupported, "Virtual thread is not 
supported.")
+val factory = virtualThreadFactory(prefix, executor)
+VirtualThreadSupport.newThreadPerTaskExecutor(factory)
+  }
+
+  private def virtualThreadFactory(prefix: String, executor: ExecutorService): 
ThreadFactory =
+try {
+  val builderClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder")

Review Comment:
   Can't get the Jdk21 only tests to find `
Class.forName("org.apache.pekko.dispatch.PekkoJdk9ForkJoinPool")`, @pjfanning 
@raboof Do you know why?
   
   Otherwise, I can only do manual testing, I tried several ways, but no luck.



-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] chore: Make code compiles on JDK 23 [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on PR #1726:
URL: https://github.com/apache/pekko/pull/1726#issuecomment-2599339230

   Is the 3.3.5-RC2 on the way, so next is 3.3.5-RC3?


-- 
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-unsubscr...@pekko.apache.org

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


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



[GH] (pekko-http): Workflow run "Nightly Builds" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Nightly Builds" on pekko-http.git has failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
f87340fdf934cb38e9554459b02a09c8e8b654c2 / scala-steward-asf[bot] 
<147768647+scala-steward-asf[bot]@users.noreply.github.com>
Update munit to 1.0.4 (#650)

Co-authored-by: scala-steward-asf[bot] 
<147768647+scala-steward-asf[bot]@users.noreply.github.com>

Report URL: https://github.com/apache/pekko-http/actions/runs/12839792104

With regards,
GitHub Actions via GitBox


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



Re: [PR] Slick - Add slick flow functions with error handling using try. [pekko-connectors]

2025-01-17 Thread via GitHub


pjfanning commented on PR #949:
URL: https://github.com/apache/pekko-connectors/pull/949#issuecomment-2598085540

   the code doesn't compile in scala 2.12


-- 
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-unsubscr...@pekko.apache.org

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


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



[GH] (pekko): Workflow run "Build and test Pekko with Scala 3" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Build and test Pekko with Scala 3" on pekko.git has 
failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
68f05878bb770bb13872bf059d1255b6d59eab40 / He-Pin 
feat: Add support for virtualize fork join pool

Report URL: https://github.com/apache/pekko/actions/runs/12830141381

With regards,
GitHub Actions via GitBox


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



[GH] (pekko): Workflow run "Generate doc check" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Generate doc check" on pekko.git has failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
68f05878bb770bb13872bf059d1255b6d59eab40 / He-Pin 
feat: Add support for virtualize fork join pool

Report URL: https://github.com/apache/pekko/actions/runs/12830141383

With regards,
GitHub Actions via GitBox


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



[GH] (pekko): Workflow run "Pull Requests" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Pull Requests" on pekko.git has failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
68f05878bb770bb13872bf059d1255b6d59eab40 / He-Pin 
feat: Add support for virtualize fork join pool

Report URL: https://github.com/apache/pekko/actions/runs/12830141393

With regards,
GitHub Actions via GitBox


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



[PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin opened a new pull request, #1724:
URL: https://github.com/apache/pekko/pull/1724

   Motivation:
   Enhances the current virtual thread support which can switch the virtual 
threads' scheduler.
   
   Modification:
   Use the method handle to change the scheduler of virtual threads.
   
   Result:
   Virtualization a virtual threads supported.


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920219797


##
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupport.scala:
##
@@ -33,20 +34,48 @@ private[dispatch] object VirtualThreadSupport {
*/
   val isSupported: Boolean = JavaVersion.majorVersion >= 21
 
+  /**
+   * Create a virtual thread executor with the given executor as the scheduler.
+   */
+  def newThreadPerTaskExecutor(prefix: String, executor: Executor): 
ExecutorService = {
+val factory = newVirtualThreadFactory(prefix, executor)
+newThreadPerTaskExecutor(factory)
+  }
+
+  /**
+   * Create a virtual thread factory with the default scheduler in 
VirtualThread.
+   */
+  def newVirtualThreadFactory(prefix: String): ThreadFactory = {
+newVirtualThreadFactory(prefix, null)
+  }
+
   /**
* Create a virtual thread factory with a executor, the executor will be 
used as the scheduler of
* virtual thread.
+   *
+   * The executor should run task on platform threads.
+   *
+   * returns null if not supported.
*/
-  def newVirtualThreadFactory(prefix: String): ThreadFactory = {
+  def newVirtualThreadFactory(prefix: String, executor: Executor): 
ThreadFactory = {
 require(isSupported, "Virtual thread is not supported.")
 try {
   val builderClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder")
   val ofVirtualClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder$OfVirtual")
   val ofVirtualMethod = lookup.findStatic(classOf[Thread], "ofVirtual", 
MethodType.methodType(ofVirtualClass))
   var builder = ofVirtualMethod.invoke()
+  if (executor ne null) { // Set the scheduler of virtual thread
+val clazz = builder.getClass
+val privateLookup = MethodHandles.privateLookupIn(
+  clazz,
+  lookup
+)
+val schedulerFieldSetter = privateLookup
+  .findSetter(clazz, "scheduler", classOf[Executor])
+schedulerFieldSetter.invoke(builder, executor)

Review Comment:
   OK!, Will handle this with Java Reflection then!



-- 
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-unsubscr...@pekko.apache.org

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


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



[GH] (pekko): Workflow run "Binary Compatibility" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Binary Compatibility" on pekko.git has failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
68f05878bb770bb13872bf059d1255b6d59eab40 / He-Pin 
feat: Add support for virtualize fork join pool

Report URL: https://github.com/apache/pekko/actions/runs/12830141436

With regards,
GitHub Actions via GitBox


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



Re: [PR] Slick - Add slick flow functions with error handling using try. [pekko-connectors]

2025-01-17 Thread via GitHub


pjfanning commented on code in PR #949:
URL: https://github.com/apache/pekko-connectors/pull/949#discussion_r1920347934


##
slick/src/test/scala/docs/scaladsl/SlickWithTryResultSpec.scala:
##
@@ -0,0 +1,355 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * license agreements; and to You under the Apache License, version 2.0:
+ *
+ *   https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * This file is part of the Apache Pekko project, which was derived from Akka.
+ */
+
+/*
+ * Copyright (C) since 2016 Lightbend Inc. 
+ */
+
+package docs.scaladsl
+
+import org.apache.pekko
+import pekko.Done
+import pekko.actor.ActorSystem
+import pekko.stream.connectors.slick.scaladsl.{ Slick, SlickSession, 
SlickWithTryResult }
+import pekko.stream.connectors.testkit.scaladsl.LogCapturing
+import pekko.stream.scaladsl._
+import pekko.testkit.TestKit
+
+import org.scalatest._
+import org.scalatest.concurrent.ScalaFutures
+import org.scalatest.matchers.must.Matchers
+import org.scalatest.wordspec.AnyWordSpec
+
+import slick.dbio.DBIOAction
+import slick.jdbc.GetResult
+
+import scala.concurrent.duration._
+import scala.concurrent.{ Await, ExecutionContext, Future }
+import scala.util.{ Failure, Success }
+
+class SlickWithTryResultSpec extends AnyWordSpec
+with ScalaFutures
+with BeforeAndAfterEach
+with BeforeAndAfterAll
+with Matchers
+with LogCapturing {
+  // #init-mat
+  implicit val system: ActorSystem = ActorSystem()
+  // #init-mat
+
+  // #init-session
+  implicit val session: SlickSession = SlickSession.forConfig("slick-h2")
+  // #init-session
+
+  import session.profile.api._
+
+  case class User(id: Int, name: String)
+  class Users(tag: Tag) extends Table[(Int, String)](tag, 
"PEKKO_CONNECTORS_SLICK_SCALADSL_TEST_USERS") {
+def id = column[Int]("ID", O.PrimaryKey)
+def name = column[String]("NAME")
+def * = (id, name)
+  }
+
+  implicit val ec: ExecutionContext = system.dispatcher
+  implicit val defaultPatience: PatienceConfig = PatienceConfig(timeout = 
3.seconds, interval = 50.millis)
+  implicit val getUserResult: GetResult[User] = GetResult(r => 
User(r.nextInt(), r.nextString()))
+
+  val users = (1 to 40).map(i => User(i, s"Name$i")).toSet
+  val duplicateUser = scala.collection.immutable.Seq(users.head, users.head)
+
+  val createTable =
+sqlu"""CREATE TABLE PEKKO_CONNECTORS_SLICK_SCALADSL_TEST_USERS(ID INTEGER 
PRIMARY KEY, NAME VARCHAR(50))"""
+  val dropTable = sqlu"""DROP TABLE 
PEKKO_CONNECTORS_SLICK_SCALADSL_TEST_USERS"""
+  val selectAllUsers = sql"SELECT ID, NAME FROM 
PEKKO_CONNECTORS_SLICK_SCALADSL_TEST_USERS".as[User]
+  val typedSelectAllUsers = TableQuery[Users].result
+
+  def insertUser(user: User): DBIO[Int] =
+sqlu"INSERT INTO PEKKO_CONNECTORS_SLICK_SCALADSL_TEST_USERS 
VALUES(${user.id}, ${user.name})"
+
+  def getAllUsersFromDb: Future[Set[User]] = 
Slick.source(selectAllUsers).runWith(Sink.seq).map(_.toSet)
+  def populate(): Unit = {
+val actions = users.map(insertUser)
+
+// This uses the standard Slick API exposed by the Slick session
+// on purpose, just to double-check that inserting data through
+// our Pekko connectors is equivalent to inserting it the Slick way.
+session.db.run(DBIO.seq(actions.toList: _*)).futureValue
+  }
+
+  override def beforeEach(): Unit = session.db.run(createTable).futureValue
+  override def afterEach(): Unit = session.db.run(dropTable).futureValue
+
+  override def afterAll(): Unit = {
+// #close-session
+system.registerOnTermination(() => session.close())
+// #close-session
+
+TestKit.shutdownActorSystem(system)
+  }
+
+  "SlickSession.forDbAndProfile" must {
+"create a slick session able to talk to the db" in {
+  // #init-session-from-db-and-profile
+  val db = Database.forConfig("slick-h2.db")
+  val profile = slick.jdbc.H2Profile
+  val slickSessionCreatedForDbAndProfile: SlickSession = 
SlickSession.forDbAndProfile(db, profile)
+  // #init-session-from-db-and-profile
+  try {
+val q = sql"select true".as[Boolean]
+val result = Slick

Review Comment:
   @minjibir why is this testing the 'Slick' object and not the new 
SlickWithTryResult object?



-- 
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-unsubscr...@pekko.apache.org

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


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



[GH] (pekko): Workflow run "Binary Compatibility" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Binary Compatibility" on pekko.git has failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
5776a32eee6453b4b899d47b0f3cc87f476444f7 / He-Pin 
feat: Add support for switching scheduler

Report URL: https://github.com/apache/pekko/actions/runs/12831701621

With regards,
GitHub Actions via GitBox


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



Re: [PR] Slick - Add slick flow functions with error handling using try. [pekko-connectors]

2025-01-17 Thread via GitHub


pjfanning commented on PR #949:
URL: https://github.com/apache/pekko-connectors/pull/949#issuecomment-2598582118

   I have committed some code changes but I'm not sure if they work yet.


-- 
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-unsubscr...@pekko.apache.org

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


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



[GH] (pekko): Workflow run "Generate doc check" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Generate doc check" on pekko.git has failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
5776a32eee6453b4b899d47b0f3cc87f476444f7 / He-Pin 
feat: Add support for switching scheduler

Report URL: https://github.com/apache/pekko/actions/runs/12831701623

With regards,
GitHub Actions via GitBox


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



Re: [PR] Slick - Add slick flow functions with error handling using try. [pekko-connectors]

2025-01-17 Thread via GitHub


pjfanning commented on PR #949:
URL: https://github.com/apache/pekko-connectors/pull/949#issuecomment-2598589428

   seeing test failure in `insert 40 records into a table (no parallelism)` 
(new Slick with try support test)
   


-- 
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-unsubscr...@pekko.apache.org

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


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



[GH] (pekko-connectors): Workflow run "CI" is working again!

2025-01-17 Thread GitBox


The GitHub Actions job "CI" on pekko-connectors.git has succeeded.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
e7e2065d9c01a3c648d8f146147af06bf6b97ac7 / PJ Fanning 

Update SlickWithTryResultSpec.scala

Report URL: https://github.com/apache/pekko-connectors/actions/runs/12831863766

With regards,
GitHub Actions via GitBox


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



[GH] (pekko): Workflow run "Binary Compatibility" is working again!

2025-01-17 Thread GitBox


The GitHub Actions job "Binary Compatibility" on pekko.git has succeeded.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
f08114ef3ba46b3d24dc854961caa34e725960b3 / He-Pin 
fix: fix when compiling with 2.12

Report URL: https://github.com/apache/pekko/actions/runs/12832017904

With regards,
GitHub Actions via GitBox


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



[GH] (pekko): Workflow run "Pull Requests" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Pull Requests" on pekko.git has failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
f08114ef3ba46b3d24dc854961caa34e725960b3 / He-Pin 
fix: fix when compiling with 2.12

Report URL: https://github.com/apache/pekko/actions/runs/12832017874

With regards,
GitHub Actions via GitBox


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



[GH] (pekko): Workflow run "Generate doc check" is working again!

2025-01-17 Thread GitBox


The GitHub Actions job "Generate doc check" on pekko.git has succeeded.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
f08114ef3ba46b3d24dc854961caa34e725960b3 / He-Pin 
fix: fix when compiling with 2.12

Report URL: https://github.com/apache/pekko/actions/runs/12832017892

With regards,
GitHub Actions via GitBox


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



[GH] (pekko): Workflow run "Pull Requests" is working again!

2025-01-17 Thread GitBox


The GitHub Actions job "Pull Requests" on pekko.git has succeeded.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
c5c305380418b3a7583a7e79788815d7a41034e8 / He-Pin 
fix: add jdk options for java 21 virtual threads tests.

Report URL: https://github.com/apache/pekko/actions/runs/12832863031

With regards,
GitHub Actions via GitBox


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



[GH] (pekko): Workflow run "Build and test Pekko with Scala 3" is working again!

2025-01-17 Thread GitBox


The GitHub Actions job "Build and test Pekko with Scala 3" on pekko.git has 
succeeded.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
c5c305380418b3a7583a7e79788815d7a41034e8 / He-Pin 
fix: add jdk options for java 21 virtual threads tests.

Report URL: https://github.com/apache/pekko/actions/runs/12832863022

With regards,
GitHub Actions via GitBox


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



[I] reproducible builds: cassandra-bundle.jar is not always rebuilt when needed [pekko-persistence-cassandra]

2025-01-17 Thread via GitHub


raboof opened a new issue, #259:
URL: https://github.com/apache/pekko-persistence-cassandra/issues/259

   Checking the 1.1.0 release, I found the cassandra-bundle.jar was a version 
`1.1.0-M0+73-9c76067f+20240712-1357-SNAPSHOT` one, rather than a freshly-built 
one.
   
   It seems `sbt +clean` does not  remove `target/cassandra-bundle.jar`.
   
   As a workaround perhaps we should manually clean out 
`cassandra-bundle/target` as part of the release process?


-- 
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-unsubscr...@pekko.apache.org.apache.org

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


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



Re: [I] reproducible builds: cassandra-bundle.jar is not always rebuilt when needed [pekko-persistence-cassandra]

2025-01-17 Thread via GitHub


pjfanning commented on issue #259:
URL: 
https://github.com/apache/pekko-persistence-cassandra/issues/259#issuecomment-2598968477

   I created 
https://github.com/apache/pekko-site/wiki/Pekko-Persistence-Cassandra-Release


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [I] reproducible builds: cassandra-bundle.jar is not always rebuilt when needed [pekko-persistence-cassandra]

2025-01-17 Thread via GitHub


pjfanning commented on issue #259:
URL: 
https://github.com/apache/pekko-persistence-cassandra/issues/259#issuecomment-2598954071

   We have a few variants of the main release doc.
   https://github.com/apache/pekko-site/wiki/Pekko-Release-Process
   
   These other docs in the pekko-site wiki (see right hand side of page above 
for links). I'll create one for Persistence Cassandra.
   
   I had a quick look at the staging jars (repository.apache.org) for 1.1.0-RC1 
and they seem to have the right names for the launcher jars.


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920624294


##
actor/src/main/resources/reference.conf:
##
@@ -487,6 +487,12 @@ pekko {
 # This config is new in Pekko v1.1.0 and only has an effect if you are 
running with JDK 9 and above.
 # Read the documentation on `java.util.concurrent.ForkJoinPool` to 
find out more. Default in hex is 0x7fff.
 maximum-pool-size = 32767
+
+# This config is new in Pekko v1.2.0 and only has an effect if you are 
running with JDK 21 and above,
+# When set to `on` but underlying runtime does not support virtual 
threads, an Exception will throw.
+# Virtualize this dispatcher as a virtual-thread-executor
+# Valid values are: `on`, `off`
+virtualize = off

Review Comment:
   behind an option



-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920624956


##
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupportReflect.scala:
##
@@ -0,0 +1,66 @@
+/*
+ * 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.dispatch
+
+import org.apache.pekko.annotation.InternalApi
+
+import java.util.concurrent.{ ExecutorService, ThreadFactory }
+import scala.util.control.NonFatal
+
+/**
+ * TODO remove this class once we drop Java 8 support
+ */
+@InternalApi
+private[dispatch] object VirtualThreadSupportReflect {
+
+  /**
+   * Create a virtual thread factory with given executor, the executor will be 
used as the scheduler of
+   * virtual thread.
+   *
+   * The executor should run task on platform threads.
+   *
+   * returns null if not supported.
+   */
+  def newThreadPerTaskExecutor(prefix: String, executor: ExecutorService): 
ExecutorService = {
+require(VirtualThreadSupport.isSupported, "Virtual thread is not 
supported.")
+val factory = virtualThreadFactory(prefix, executor)
+VirtualThreadSupport.newThreadPerTaskExecutor(factory)
+  }
+
+  private def virtualThreadFactory(prefix: String, executor: ExecutorService): 
ThreadFactory =
+try {
+  val builderClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder")
+  val ofVirtualClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder$OfVirtual")
+  val ofVirtualMethod = classOf[Thread].getDeclaredMethod("ofVirtual")
+  var builder = ofVirtualMethod.invoke(null)
+  if (executor != null) {
+val clazz = builder.getClass
+val field = clazz.getDeclaredField("scheduler")
+field.setAccessible(true)
+field.set(builder, executor)
+  }
+  val nameMethod = ofVirtualClass.getDeclaredMethod("name", 
classOf[String], classOf[Long])
+  val factoryMethod = builderClass.getDeclaredMethod("factory")
+  val zero = java.lang.Long.valueOf(0L)
+  builder = nameMethod.invoke(builder, prefix + "-virtual-thread-", zero)
+  factoryMethod.invoke(builder).asInstanceOf[ThreadFactory]
+} catch {
+  case NonFatal(e) =>
+throw new UnsupportedOperationException("Failed to create virtual 
thread factory", e)
+}
+}

Review Comment:
   Have to use this, because of  Java 8



-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920625671


##
docs/src/main/paradox/typed/dispatchers.md:
##
@@ -127,13 +127,18 @@ allocated by the ForkJoinPool. It is a setting 
specifically talking about the nu
 threads the pool will keep running in order to reduce the latency of handling 
a new incoming task.
 You can read more about parallelism in the JDK's [ForkJoinPool 
documentation](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ForkJoinPool.html).
 
+When Running on Java 9+, you can use `maximum-pool-size` to set the upper 
bound on the total number of threads allocated by the ForkJoinPool.
+Experimental: When Running on Java 21+, you can use `virtualize=on` to enable 
the virtual threads feature. 

Review Comment:
   ```suggestion
   Experimental: When Running on Java 21+, you can use `virtualize=on` to 
enable the virtual threads feature. 
   
   ```



-- 
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-unsubscr...@pekko.apache.org

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


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



[GH] (pekko-connectors): Workflow run "CI" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "CI" on pekko-connectors.git has failed.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
8f7b75ae2d9031e7d5e1cf1e501ea6d4e79be1bf / PJ Fanning 

Update SlickWithTryResultSpec.scala

Report URL: https://github.com/apache/pekko-connectors/actions/runs/12827922546

With regards,
GitHub Actions via GitBox


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



Re: [PR] feat: Add flatmapConcat with parallelism support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on PR #1702:
URL: https://github.com/apache/pekko/pull/1702#issuecomment-2598168437

   @pjfanning @raboof @jrudolph @mdedetrich Would you like to give this some 
care:)


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [I] genjavadoc plugin breaking publish nightly job [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on issue #1706:
URL: https://github.com/apache/pekko/issues/1706#issuecomment-2598171021

   It's been released, and is now green.


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [I] genjavadoc plugin breaking publish nightly job [pekko]

2025-01-17 Thread via GitHub


He-Pin closed issue #1706: genjavadoc plugin breaking publish nightly job
URL: https://github.com/apache/pekko/issues/1706


-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920630777


##
project/JdkOptions.scala:
##
@@ -49,6 +49,11 @@ object JdkOptions extends AutoPlugin {
 
   lazy val versionSpecificJavaOptions =
 if (isJdk17orHigher) {
+  // for virtual threads
+  "--add-opens=java.base/sun.misc=ALL-UNNAMED" ::
+  "--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED" ::
+  "--add-opens=java.base/java.lang=ALL-UNNAMED" ::
+  "--add-opens=java.base/java.util=ALL-UNNAMED" ::

Review Comment:
   need this to run the tests



-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920631243


##
docs/src/main/paradox/dispatchers.md:
##
@@ -42,6 +42,10 @@ allocated by the ForkJoinPool. It is a setting specifically 
talking about the nu
 threads the pool keep running in order to reduce the latency of handling a new 
incoming task.
 You can read more about parallelism in the JDK's [ForkJoinPool 
documentation](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ForkJoinPool.html).
 
+When Running on Java 9+, you can use `maximum-pool-size` to set the upper 
bound on the total number of threads allocated by the ForkJoinPool.

Review Comment:
   Add a document about @pjfanning 's addition.



-- 
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-unsubscr...@pekko.apache.org

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


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


pjfanning commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920633117


##
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupportReflect.scala:
##
@@ -0,0 +1,66 @@
+/*
+ * 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.dispatch
+
+import org.apache.pekko.annotation.InternalApi
+
+import java.util.concurrent.{ ExecutorService, ThreadFactory }
+import scala.util.control.NonFatal
+
+/**
+ * TODO remove this class once we drop Java 8 support
+ */
+@InternalApi
+private[dispatch] object VirtualThreadSupportReflect {
+
+  /**
+   * Create a virtual thread factory with given executor, the executor will be 
used as the scheduler of
+   * virtual thread.
+   *
+   * The executor should run task on platform threads.
+   *
+   * returns null if not supported.
+   */
+  def newThreadPerTaskExecutor(prefix: String, executor: ExecutorService): 
ExecutorService = {
+require(VirtualThreadSupport.isSupported, "Virtual thread is not 
supported.")
+val factory = virtualThreadFactory(prefix, executor)
+VirtualThreadSupport.newThreadPerTaskExecutor(factory)
+  }
+
+  private def virtualThreadFactory(prefix: String, executor: ExecutorService): 
ThreadFactory =
+try {
+  val builderClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder")

Review Comment:
   can this be done with MethodHandles?



-- 
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-unsubscr...@pekko.apache.org

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


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



[GH] (pekko): Workflow run "Binary Compatibility" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Binary Compatibility" on pekko.git has failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
9bb007dc940e608fc707866fea55c13524933a53 / He-Pin 
feat: Add support for switching scheduler

Report URL: https://github.com/apache/pekko/actions/runs/12835140738

With regards,
GitHub Actions via GitBox


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



[GH] (pekko): Workflow run "Binary Compatibility" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Binary Compatibility" on pekko.git has failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
262b62728c12874858da9ddbb0fbe305b0d55ba8 / He-Pin 
feat: Add support for switching scheduler

Report URL: https://github.com/apache/pekko/actions/runs/12835182209

With regards,
GitHub Actions via GitBox


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



Re: [I] Make code compiles on JDK 23 [pekko]

2025-01-17 Thread via GitHub


pjfanning commented on issue #1725:
URL: https://github.com/apache/pekko/issues/1725#issuecomment-2599030443

   see https://github.com/apache/pekko/pull/1534


-- 
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-unsubscr...@pekko.apache.org

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


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



[GH] (pekko): Workflow run "Binary Compatibility" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Binary Compatibility" on pekko.git has failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
ae22aa160e9b561551c19402b010279838970238 / He-Pin(kerr) 
Update docs/src/main/paradox/typed/dispatchers.md

Report URL: https://github.com/apache/pekko/actions/runs/12835169643

With regards,
GitHub Actions via GitBox


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



Re: [I] Make code compiles on JDK 23 [pekko]

2025-01-17 Thread via GitHub


pjfanning commented on issue #1725:
URL: https://github.com/apache/pekko/issues/1725#issuecomment-2599034323

   My view is that we should disable the deprecated code checks when building 
with Java 23+ (ie not have scalac flags like `-Werror` and flags like that - 
that cause the build to fail if we use deprecated code). We can still use these 
 scalac flags for Java 21 and below.


-- 
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-unsubscr...@pekko.apache.org

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


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



[GH] (pekko): Workflow run "Binary Compatibility" failed!

2025-01-17 Thread GitBox


The GitHub Actions job "Binary Compatibility" on pekko.git has failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
fc2f4d72d5acdb1fb6622c1bcaffa6a9936bc4f3 / He-Pin 
feat: Add support for switching scheduler

Report URL: https://github.com/apache/pekko/actions/runs/12835201983

With regards,
GitHub Actions via GitBox


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



Re: [PR] Enhance virtual thread support [pekko]

2025-01-17 Thread via GitHub


He-Pin commented on code in PR #1724:
URL: https://github.com/apache/pekko/pull/1724#discussion_r1920645294


##
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupportReflect.scala:
##
@@ -0,0 +1,66 @@
+/*
+ * 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.dispatch
+
+import org.apache.pekko.annotation.InternalApi
+
+import java.util.concurrent.{ ExecutorService, ThreadFactory }
+import scala.util.control.NonFatal
+
+/**
+ * TODO remove this class once we drop Java 8 support
+ */
+@InternalApi
+private[dispatch] object VirtualThreadSupportReflect {
+
+  /**
+   * Create a virtual thread factory with given executor, the executor will be 
used as the scheduler of
+   * virtual thread.
+   *
+   * The executor should run task on platform threads.
+   *
+   * returns null if not supported.
+   */
+  def newThreadPerTaskExecutor(prefix: String, executor: ExecutorService): 
ExecutorService = {
+require(VirtualThreadSupport.isSupported, "Virtual thread is not 
supported.")
+val factory = virtualThreadFactory(prefix, executor)
+VirtualThreadSupport.newThreadPerTaskExecutor(factory)
+  }
+
+  private def virtualThreadFactory(prefix: String, executor: ExecutorService): 
ThreadFactory =
+try {
+  val builderClass = 
ClassLoader.getSystemClassLoader.loadClass("java.lang.Thread$Builder")

Review Comment:
   I did this with MethodHandle in https://github.com/com-lihaoyi/cask/pull/159
   
   The `privateLookup` only exists in Java 9...



-- 
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-unsubscr...@pekko.apache.org

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


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