Module: ActiveJob::Temporal::WorkerRegistrations
- Defined in:
- lib/activejob/temporal/worker_registrations.rb
Overview
Resolves which workflows and activities a worker registers, from configuration.
By default a worker hosts the built-in ActiveJob workloads. worker_activities
adds custom activity classes - for example activities invoked by workflows owned
by another service, where only the activity name and JSON payloads travel over
the wire. Setting worker_activejob_workloads = false turns the worker into an
activities-only worker that hosts nothing but those custom activities.
Defined Under Namespace
Classes: Result
Class Method Summary collapse
-
.resolve(configuration) ⇒ Result
Configuration validation rejects the nothing-to-register combination up front (see Configuration#validate_worker_registration_settings).
Class Method Details
.resolve(configuration) ⇒ Result
Configuration validation rejects the nothing-to-register combination up front (see Configuration#validate_worker_registration_settings).
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/activejob/temporal/worker_registrations.rb', line 25 def resolve(configuration) workflows = [] activities = custom_activities(configuration) if configuration.worker_activejob_workloads workflows += [ Workflows::AjWorkflow, Workflows::DeadLetterWorkflow ] activities += [ Activities::RateLimitActivity, Activities::DependencyStatusActivity, Activities::AjRunnerActivity ] end Result.new(workflows: workflows, activities: activities) end |