class Dynflow::Executors::Parallel::Worker

Public Class Methods

new(pool, transaction_adapter) click to toggle source
# File lib/dynflow/executors/parallel/worker.rb, line 5
def initialize(pool, transaction_adapter)
  @pool                = Type! pool, Concurrent::Actor::Reference
  @transaction_adapter = Type! transaction_adapter, TransactionAdapters::Abstract
end

Public Instance Methods

on_message(work_item) click to toggle source
# File lib/dynflow/executors/parallel/worker.rb, line 10
def on_message(work_item)
  work_item.execute
rescue Errors::PersistenceError => e
  @pool.tell([:handle_persistence_error, e])
ensure
  @pool.tell([:worker_done, reference, work_item])
  @transaction_adapter.cleanup
end