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


##########
actor/src/main/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfigurator.scala:
##########
@@ -84,12 +85,28 @@ class ForkJoinExecutorConfigurator(config: Config, 
prerequisites: DispatcherPrer
   class ForkJoinExecutorServiceFactory(
       val threadFactory: ForkJoinPool.ForkJoinWorkerThreadFactory,
       val parallelism: Int,
-      val asyncMode: Boolean)
+      val asyncMode: Boolean,
+      val maxPoolSize: Int)
       extends ExecutorServiceFactory {
+
+    def this(threadFactory: ForkJoinPool.ForkJoinWorkerThreadFactory,
+        parallelism: Int,
+        asyncMode: Boolean) = this(threadFactory, parallelism, asyncMode, 
ForkJoinPoolConstants.MaxCap)
+
+    private lazy val pekkoJdk9ForkJoinPoolClassOpt: Option[Class[_]] =
+      
Try(Class.forName("org.apache.pekko.dispatch.PekkoJdk9ForkJoinPool")).toOption

Review Comment:
   ```scala
   private lazy val pekkoJdk9ForkJoinPoolHandleOpt: Option[MethodHandle] = {
        if (JavaVersion.majorVersion >= 9) {
         pekkoJdk9ForkJoinPoolClassOpt.map { clz =>
           val methodHandleLookup = MethodHandles.lookup()
           val mt = MethodType.methodType(classOf[Unit], classOf[Int],
             classOf[ForkJoinPool.ForkJoinWorkerThreadFactory],
             classOf[Int], classOf[Thread.UncaughtExceptionHandler], 
classOf[Boolean])
           methodHandleLookup.findConstructor(clz, mt)
         }} else None
       }
   ```



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

To unsubscribe, e-mail: [email protected]

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


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

Reply via email to