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

Split abstract job processor #451

Merged
merged 36 commits into from
Feb 10, 2025
Merged

Conversation

andrewi-wd
Copy link
Contributor

@andrewi-wd andrewi-wd commented Feb 6, 2025

Changes

Previously the same class was responsible for scheduling and processing the job. This caused circular dependency situation in case job processor X depended on some method from the Service A to process a job, while same Service A was scheduling an instance of a job X from another method.

In this PR we are separating job scheduling and job processing logic, eliminating circular dependency risk.

(and while we are at it, improving type-safety via runtime validation)

Checklist

  • Apply one of following labels; major, minor, patch or skip-release
  • I've updated the documentation, or no changes were necessary
  • I've updated the tests, or no changes were necessary

@andrewi-wd andrewi-wd marked this pull request as ready for review February 7, 2025 11:36
@andrewi-wd andrewi-wd requested review from dariacm and a team as code owners February 7, 2025 11:36
@kibertoad kibertoad added minor and removed major labels Feb 7, 2025
kibertoad and others added 2 commits February 7, 2025 13:48
* Adding default job schema

* Creating types file

* Using new types on manager classes

* Lint fixes

* js import fix

* Test fix
andrewi-wd and others added 6 commits February 7, 2025 17:39
* Adding missing export

* Adding support for JobPro options

* Adding new types avoiding queue options on new processor

* Adding queue options genetic

* Fix test

* Trying to improve types

* Type fix

* Minor fix

* Lint fix

* Introducing queue registry to simplify set up process

* Type fix

* Lint fixes

* Fixing tests

* Removing comment

* Test fix

* Improving tests

* Improving coverage

* lint fix

* using expect error
* Queue is available with proper typing on processor

* Lint fix

* Adjusting tests

* Minor fix

* Minor type improvement

* Removing worker auto run enabled

* Removing lazy init from processor config

* Job payload type safe with queue config

* Lint fixes

* Test fixes

* More lint fixes

* Minor change

* Minor changes

* Minor rename

* Minor issue fix

* Factory split

* Type issue fix

* Adding missing tests

* Type simplification

* Fixing queue manager spy type inference

* Factory merge

* Test fix

* Type fix
packages/app/background-jobs-common/README.md Outdated Show resolved Hide resolved
andrewi-wd and others added 3 commits February 10, 2025 14:26
@andrewi-wd andrewi-wd merged commit 14bb856 into main Feb 10, 2025
4 checks passed
@andrewi-wd andrewi-wd deleted the feat/split_abstract_job_processor branch February 10, 2025 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants