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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic task queue with worker pool #82

Merged
merged 19 commits into from
Apr 24, 2022
Merged

Generic task queue with worker pool #82

merged 19 commits into from
Apr 24, 2022

Conversation

adzialocha
Copy link
Member

@adzialocha adzialocha commented Apr 13, 2022

Generic task queue with worker pool with a nice test simulating a jigsaw puzzle game. Closes: #83

Todo

  • Better naming of all traits and structs
  • Add puzzle test
  • Add documentation

Next Steps

These issues came up during development of this PR but it makes sense to tackle them in separate PRs, together with refactoring the current TaskManager in tasks.rs:

馃搵 Checklist

  • Add tests that cover your changes
  • Add this PR to the Unreleased section in CHANGELOG.md
  • Link this PR to any issues it closes
  • New files contain a SPDX license header

@adzialocha adzialocha marked this pull request as draft April 13, 2022 16:15
@sandreae
Copy link
Member

鉂わ笍 鉂わ笍 鉂わ笍 鉂わ笍 鉂わ笍 鉂わ笍 鉂わ笍 鉂わ笍 good memories 馃ぃ

@adzialocha
Copy link
Member Author

heart heart heart heart heart heart heart heart good memories rofl

I knoow! 鉂わ笍 Of course, please commit anything here!

@sandreae
Copy link
Member

I like the new naming 馃憤

@adzialocha
Copy link
Member Author

adzialocha commented Apr 15, 2022

I've started the puzzle test yesterday, but I'm not sure what the workers did again ..

  • "Pick worker" Pick incoming piece p and move it into database, For every related puzzle piece of p and p itself dispatch a dependency task
  • "Dependency worker" Check if dependencies exist for piece g, if yes, flip "connected" flag of g to true and move them to same puzzle h, if true dispatch finish puzzle task for puzzle h
  • "Finish worker" Check if all puzzle pieces in h are flipped to true, if yes, flip "complete" flag of h to true?

馃

@sandreae

@sandreae
Copy link
Member

Yes! I think that's exactly it.

We skipped any concept of "materialising a puzzle piece".

@adzialocha adzialocha changed the title Task queue with worker pool Generic task queue with worker pool Apr 16, 2022
@adzialocha adzialocha marked this pull request as ready for review April 19, 2022 09:29
Copy link
Member

@sandreae sandreae left a comment

Choose a reason for hiding this comment

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

Huhu! I liked looking through this again, so great to have a custom task queue for everything we will be working on shortly. It was also useful for the sake of rust learning ;-p thanks for tidying it up and the renaming has worked well I think.

The docs are also niiice 馃憤

There is one section of the test setup I can't get my head around, but that's a small detail I would just like to get if I can.

aquadoggo/src/worker.rs Outdated Show resolved Hide resolved
aquadoggo/src/worker.rs Outdated Show resolved Hide resolved
Copy link
Member

@sandreae sandreae left a comment

Choose a reason for hiding this comment

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

Huhu! I liked looking through this again, so great to have a custom task queue for everything we will be working on shortly. It was also useful for the sake of rust learning ;-p thanks for tidying it up and the renaming has worked well I think.

The docs are also niiice 馃憤

There is one section of the test setup I can't get my head around, but that's a small detail I would just like to get if I can.

@adzialocha adzialocha merged commit fb6e7d7 into main Apr 24, 2022
@adzialocha adzialocha deleted the task-worker-queue branch April 24, 2022 10:40
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.

Implement a generic task queue with worker pool
2 participants