Sha256: 37b1938fb9a42503480b54fd443ade51bf6af6bf527dbc3e51de57c2705a5fb2

Contents?: true

Size: 645 Bytes

Versions: 8

Compression:

Stored size: 645 Bytes

Contents

module Dynflow
  module Executors
    class Parallel < Abstract
      class Worker < Actor
        def initialize(pool, transaction_adapter)
          @pool                = Type! pool, Concurrent::Actor::Reference
          @transaction_adapter = Type! transaction_adapter, TransactionAdapters::Abstract
        end

        def on_message(work_item)
          Executors.run_user_code do
            work_item.execute
          end
        rescue Errors::PersistenceError => e
          @pool.tell([:handle_persistence_error, e])
        ensure
          @pool.tell([:worker_done, reference, work_item])
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dynflow-1.1.0 lib/dynflow/executors/parallel/worker.rb
dynflow-1.0.5 lib/dynflow/executors/parallel/worker.rb
dynflow-1.0.4 lib/dynflow/executors/parallel/worker.rb
dynflow-1.0.3 lib/dynflow/executors/parallel/worker.rb
dynflow-1.0.2 lib/dynflow/executors/parallel/worker.rb
dynflow-1.0.1 lib/dynflow/executors/parallel/worker.rb
dynflow-1.0.0 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.37 lib/dynflow/executors/parallel/worker.rb