Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[scheduler] pekko integration #1032

Merged
merged 4 commits into from
Jan 20, 2025
Merged

[scheduler] pekko integration #1032

merged 4 commits into from
Jan 20, 2025

Conversation

fwbrasil
Copy link
Collaborator

Fixes #1028

import scala.concurrent.Promise
import scala.concurrent.duration.*

class KyoExecutorServiceConfiguratorTest
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@He-Pin I think the last time I used Akka/Pekko was a decade ago :) Does it have custom locals/threadlocals that we need to check for propagation like in Finagle's integration?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, NO, thread local is rarely used.

val actor = system.actorOf(Props(new Actor {
def receive = {
case _ =>
executorThread = Thread.currentThread()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better with an ask/? and reply with the thread name,eg : apache/pekko#1728

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

case msg =>
threadNames.synchronized {
threadNames += Thread.currentThread().getName
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just sender ! Thread.currentThread().getName

* [[org.apache.pekko.dispatch.ExecutorServiceConfigurator]] for the Pekko dispatcher interface
*/
class KyoExecutorServiceConfigurator(config: Config, prerequisites: DispatcherPrerequisites)
extends ExecutorServiceConfigurator(config, prerequisites) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we configure the Kyo scheduler in detail? Seems it's just using the default one.

Copy link
Collaborator Author

@fwbrasil fwbrasil Jan 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kyo's scheduler is designed to work as a JVM-global resource so it doesn't allow creating separate instances. It has several configs that can be set via system properties but I'd recommend trying the defaults first.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elegant

build.sbt Outdated Show resolved Hide resolved
Co-authored-by: Ondra Pelech <[email protected]>
@fwbrasil
Copy link
Collaborator Author

/release

@fwbrasil fwbrasil merged commit af67df8 into main Jan 20, 2025
3 checks passed
@fwbrasil fwbrasil deleted the scheduler-pekko branch January 20, 2025 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

What should be done to use kyo-scheduler in pekko?
4 participants