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

improve: Only load async workers if deps available #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jylamont
Copy link
Contributor

@jylamont jylamont commented Feb 24, 2025

This PR aims to further insulate queue workers implementations if your app doesn't have this dependency. Zeitwerk will only load the code if a constant like Sidekiq is defined.

Copy link
Contributor Author

jylamont commented Feb 24, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@jylamont jylamont force-pushed the 02-21-improve_only_load_async_workers_if_deps_available branch from 3acabf6 to eaac98d Compare February 24, 2025 14:56
@jylamont jylamont force-pushed the 02-21-refactor_refactor branch from 89cf450 to fe85416 Compare February 24, 2025 14:56
@jylamont jylamont force-pushed the 02-21-improve_only_load_async_workers_if_deps_available branch from eaac98d to 5ee246b Compare February 24, 2025 14:59
@jylamont jylamont force-pushed the 02-21-refactor_refactor branch from fe85416 to 801ef51 Compare February 24, 2025 14:59
@jylamont jylamont force-pushed the 02-21-improve_only_load_async_workers_if_deps_available branch from 5ee246b to 38eb412 Compare February 24, 2025 15:04
@jylamont jylamont marked this pull request as ready for review February 24, 2025 15:05
@jylamont jylamont force-pushed the 02-21-improve_only_load_async_workers_if_deps_available branch 2 times, most recently from 0c3a807 to 6405f8e Compare February 24, 2025 15:17
@jylamont jylamont force-pushed the 02-21-refactor_refactor branch 2 times, most recently from 13ff379 to 4b753e0 Compare February 24, 2025 15:23
@jylamont jylamont force-pushed the 02-21-improve_only_load_async_workers_if_deps_available branch from 6405f8e to feca23f Compare February 24, 2025 15:23
@jylamont jylamont force-pushed the 02-21-refactor_refactor branch 2 times, most recently from 9d5158f to 913e239 Compare February 24, 2025 15:24
@jylamont jylamont force-pushed the 02-21-improve_only_load_async_workers_if_deps_available branch from feca23f to 56dea5f Compare February 24, 2025 15:24
@jylamont jylamont force-pushed the 02-21-refactor_refactor branch from 913e239 to f340488 Compare February 24, 2025 15:49
@jylamont jylamont force-pushed the 02-21-improve_only_load_async_workers_if_deps_available branch from 56dea5f to f5b98f5 Compare February 24, 2025 15:49
@jylamont jylamont force-pushed the 02-21-refactor_refactor branch from f340488 to db57f51 Compare February 24, 2025 17:39
@jylamont jylamont force-pushed the 02-21-improve_only_load_async_workers_if_deps_available branch from f5b98f5 to a722f66 Compare February 24, 2025 17:39
@jylamont jylamont force-pushed the 02-21-refactor_refactor branch from db57f51 to bac9ac2 Compare February 24, 2025 23:28
@jylamont jylamont force-pushed the 02-21-improve_only_load_async_workers_if_deps_available branch from a722f66 to cf891bb Compare February 24, 2025 23:28
@jylamont jylamont force-pushed the 02-21-refactor_refactor branch from bac9ac2 to 488e0ad Compare February 24, 2025 23:29
@jylamont jylamont force-pushed the 02-21-improve_only_load_async_workers_if_deps_available branch from cf891bb to 0df5db5 Compare February 24, 2025 23:29
@jylamont jylamont force-pushed the 02-21-refactor_refactor branch from 488e0ad to f8f4c2f Compare February 25, 2025 16:43
@jylamont jylamont force-pushed the 02-21-improve_only_load_async_workers_if_deps_available branch 2 times, most recently from d3a290c to d01b0a9 Compare February 25, 2025 17:41
@jylamont jylamont force-pushed the 02-21-refactor_refactor branch from f8f4c2f to 605307f Compare February 25, 2025 17:41
@jylamont jylamont changed the base branch from 02-21-refactor_refactor to graphite-base/89 February 25, 2025 17:51
@jylamont jylamont force-pushed the 02-21-improve_only_load_async_workers_if_deps_available branch from d01b0a9 to 5cc0b0c Compare February 25, 2025 17:53
@jylamont jylamont changed the base branch from graphite-base/89 to master February 25, 2025 17:54
@jylamont jylamont force-pushed the 02-21-improve_only_load_async_workers_if_deps_available branch from 5cc0b0c to f873ff0 Compare February 25, 2025 17:54
@jylamont jylamont requested a review from Copilot February 26, 2025 17:19

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

lib/vero/workers/resque_worker.rb:9

  • The removal of the options.transform_keys call in ResqueWorker may affect the expected key format. Please verify that Vero::Senders::Base.new.call handles options consistently without requiring symbolized keys.
Vero::Senders::Base.new.call(api_class, domain, options)

lib/vero.rb:29

  • Since the SuckerPunchWorker has been relocated from lib/vero/sucker_punch_worker.rb to lib/vero/workers/sucker_punch_worker.rb, please confirm that the ignore path is correct and matches the new file structure.
loader.ignore("#{__dir__}/vero/workers/sucker_punch_worker") unless defined?(SuckerPunch)
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.

1 participant