Skip to content

Stub adapter methods for async adapter #195

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

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions lib/active_job/queue_adapters/async_ext.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
module ActiveJob::QueueAdapters::AsyncExt
include MissionControl::Jobs::Adapter

# List of filters supported natively. Non-supported filters are done in memory.
def supported_job_filters(jobs_relation)
[]
end

def supports_queue_pausing?
false
end

def queues
[]
end

def queue_size(*)
0
end

def clear_queue(*)
end

def jobs_count(*)
0
end

def fetch_jobs(*)
[]
end

def retry_all_jobs(*)
end

def retry_job(job, *)
end

def discard_all_jobs(*)
end

def discard_job(*)
end

def dispatch_job(*)
end

def find_job(*)
end
end
2 changes: 1 addition & 1 deletion lib/mission_control/jobs/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Engine < ::Rails::Engine
ActiveJob::QueueAdapters::SolidQueueAdapter.prepend ActiveJob::QueueAdapters::SolidQueueExt
end

ActiveJob::QueueAdapters::AsyncAdapter.include MissionControl::Jobs::Adapter
ActiveJob::QueueAdapters::AsyncAdapter.include ActiveJob::QueueAdapters::AsyncExt
end

config.after_initialize do |app|
Expand Down
4 changes: 2 additions & 2 deletions test/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Application < Rails::Application
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")

# Mission Control supported adapters
config.mission_control.jobs.adapters = [ :resque, :solid_queue ]
# Mission Control configured adapters
config.mission_control.jobs.adapters = [ :resque, :solid_queue, :async ]
end
end