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

Re: [PR] chore: disable batch if isVirtualized [pekko]

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


##########
actor/src/main/scala/org/apache/pekko/dispatch/Dispatcher.scala:
##########
@@ -64,16 +64,20 @@ class Dispatcher(
     new LazyExecutorServiceDelegate(executorServiceFactoryProvider.createExecutorServiceFactory(id, threadFactory))
 
   protected final def executorService: ExecutorServiceDelegate = executorServiceDelegate
+  protected final def isVirtualized: Boolean = executorServiceFactoryProvider.isVirtualized
 
   /**
    * INTERNAL API
    */
   protected[pekko] def dispatch(receiver: ActorCell, invocation: Envelope): Unit = {
     val mbox = receiver.mailbox
     mbox.enqueue(receiver.self, invocation)
-    registerForExecution(mbox, true, false)
+    registerForExecution(mbox, hasMessageHint = true, hasSystemMessageHint = false)
   }
 
+  final override def batchable(runnable: Runnable): Boolean =
+    if (isVirtualized) true else super.batchable(runnable)

Review Comment:
   the PR title says 'disable batch if isVirtualized' but this seems to be the opposite



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

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

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


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