Sha256: f23d522051ab4458c3dd94946518801317a3949be5cd5d4c8244368acc262190

Contents?: true

Size: 631 Bytes

Versions: 20

Compression:

Stored size: 631 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)
          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
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
dynflow-0.8.36 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.35 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.34 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.33 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.32 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.31 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.30 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.29 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.28 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.27 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.26 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.25 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.24 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.23 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.22 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.21 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.20 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.19 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.18 lib/dynflow/executors/parallel/worker.rb
dynflow-0.8.17 lib/dynflow/executors/parallel/worker.rb