Class: Textus::Application::Write::RefreshOrchestrator
- Inherits:
-
Object
- Object
- Textus::Application::Write::RefreshOrchestrator
- Defined in:
- lib/textus/application/write/refresh_orchestrator.rb
Instance Method Summary collapse
- #execute(action, key:) ⇒ Object
-
#initialize(worker:, store_root:, events:, ctx: nil, hook_context: nil, detached_spawner: nil) ⇒ RefreshOrchestrator
constructor
A new instance of RefreshOrchestrator.
Constructor Details
#initialize(worker:, store_root:, events:, ctx: nil, hook_context: nil, detached_spawner: nil) ⇒ RefreshOrchestrator
Returns a new instance of RefreshOrchestrator.
5 6 7 8 9 10 11 12 |
# File 'lib/textus/application/write/refresh_orchestrator.rb', line 5 def initialize(worker:, store_root:, events:, ctx: nil, hook_context: nil, detached_spawner: nil) @worker = worker @store_root = store_root @events = events @ctx = ctx @hook_context = hook_context @detached_spawner = detached_spawner || default_spawner end |
Instance Method Details
#execute(action, key:) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/textus/application/write/refresh_orchestrator.rb', line 14 def execute(action, key:) case action when Textus::Domain::Action::Return then Textus::Domain::Outcome::Skipped.new when Textus::Domain::Action::RefreshSync then run_sync(key) when Textus::Domain::Action::RefreshTimed then run_timed(action.budget_ms, key) else raise ArgumentError.new("unknown action: #{action.inspect}") end end |