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

feat(workers): Create a ThreadPool for each worker [fixes NET-688] #2012

Merged
merged 17 commits into from
Jan 15, 2024

Conversation

gurinderu
Copy link
Contributor

@gurinderu gurinderu commented Jan 4, 2024

Description

Create a ThreadPool for each worker.

Motivation

We needed to isolate each worker on a separate CU

Related Issue(s)

NET-688

Proposed Changes

  • Added a runtime creation on worker creation
  • On the actor creation get a worker runtime handle if it exists
  • Introduced a Spawner entity that allows to shift executions on the different pools

Checklist

  • The code follows the project's coding conventions and style guidelines.
  • All tests related to the changes have passed successfully.
  • Documentation has been updated to reflect the changes (if applicable).
  • All new and existing unit tests have passed.
  • I have self-reviewed my code and ensured its quality.
  • I have added/updated necessary comments to aid understanding.

Reviewer Checklist

  • Code has been reviewed for quality and adherence to guidelines.
  • Tests have been reviewed and are sufficient to validate the changes.
  • Documentation has been reviewed and is up to date.
  • Any questions or concerns have been addressed.

Copy link

linear bot commented Jan 4, 2024

@gurinderu gurinderu changed the title wip feat(worker): Create a ThreadPool for each worker Jan 4, 2024
@gurinderu gurinderu changed the title feat(worker): Create a ThreadPool for each worker feat(workers): Create a ThreadPool for each worker Jan 4, 2024
@gurinderu gurinderu changed the title feat(workers): Create a ThreadPool for each worker feat(workers): Create a ThreadPool for each worker [fixes NET-688] Jan 5, 2024
@gurinderu gurinderu marked this pull request as ready for review January 8, 2024 12:45
@gurinderu gurinderu requested review from folex, justprosh and kmd-fl and removed request for folex and justprosh January 8, 2024 12:45
@gurinderu gurinderu added the e2e Run e2e workflow label Jan 8, 2024
aquamarine/src/actor.rs Outdated Show resolved Hide resolved
aquamarine/src/particle_functions.rs Outdated Show resolved Hide resolved
aquamarine/src/particle_functions.rs Outdated Show resolved Hide resolved
aquamarine/src/plumber.rs Outdated Show resolved Hide resolved
crates/workers/src/error.rs Outdated Show resolved Hide resolved
crates/workers/src/workers.rs Outdated Show resolved Hide resolved
crates/workers/src/workers.rs Outdated Show resolved Hide resolved
crates/workers/src/workers.rs Outdated Show resolved Hide resolved
crates/workers/src/workers.rs Outdated Show resolved Hide resolved
crates/workers/src/workers.rs Outdated Show resolved Hide resolved
Copy link
Member

@folex folex left a comment

Choose a reason for hiding this comment

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

nice!

aquamarine/src/spawner.rs Outdated Show resolved Hide resolved
@gurinderu gurinderu requested a review from folex January 13, 2024 21:41
aquamarine/src/spawner.rs Outdated Show resolved Hide resolved
Copy link
Member

@folex folex left a comment

Choose a reason for hiding this comment

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

What is enum_dispatch, and how it affects the code?

@gurinderu
Copy link
Contributor Author

gurinderu commented Jan 15, 2024

enum_dispatch

https://crates.io/crates/enum_dispatch

Shortly speaking it is a faster version of dynamic dispatch.

@gurinderu gurinderu enabled auto-merge (squash) January 15, 2024 18:24
@gurinderu gurinderu merged commit fa5a17a into master Jan 15, 2024
15 checks passed
@gurinderu gurinderu deleted the feature/net-688 branch January 15, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants