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

Fixed WorkerPool to handle remote actors properly #1164

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

akbashev
Copy link
Contributor

Currently WorkerPool:

  • Treats remote actors as weak and cleans them directly
  • Doesn't work on Swift 6 mode as WorkItem and WorkResult are not marked as Sendable

This PR fixes this, basically cherry picked changes from this PR #1159 and updated tests

wip

wip

strong ref fix
@akbashev akbashev marked this pull request as ready for review October 15, 2024 15:01
@akbashev
Copy link
Contributor Author

Hm, would be nice to add test to check remote actors also.

///
/// We could consider implementing a strict round robin strategy which remains strict even
/// as new workers arrive in the pool.
case simpleRoundRobin
}
Copy link
Member

Choose a reason for hiding this comment

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

Again we should make a struct with an underlying enum inside it, and make static functions to create instances. Otherwise by making the enum public we'll never be able to add new cases without a major release.

Copy link
Member

@ktoso ktoso left a comment

Choose a reason for hiding this comment

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

Looks good, just needs to be careful with the enums and maybe add one more test?

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.

2 participants