Sha256: a8509aca3d4c39bcef391e87d01b00f002091ca142fa1c4a92ca358536299052

Contents?: true

Size: 803 Bytes

Versions: 51

Compression:

Stored size: 803 Bytes

Contents

module Dynflow
  module Testing
    class DummyExecutor
      attr_reader :world

      def initialize(world)
        @world             = world
        @events_to_process = []
      end

      def event(execution_plan_id, step_id, event, future = Concurrent.future)
        @events_to_process << [execution_plan_id, step_id, event, future]
      end

      # returns true if some event was processed.
      def progress
        events = @events_to_process.dup
        clear
        events.each do |execution_plan_id, step_id, event, future|
          future.success true
          if event && world.action.state != :suspended
            return false
          end
          world.action.execute event
        end
      end

      def clear
        @events_to_process.clear
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
dynflow-1.1.6 lib/dynflow/testing/dummy_executor.rb
dynflow-1.1.5 lib/dynflow/testing/dummy_executor.rb
dynflow-1.1.4 lib/dynflow/testing/dummy_executor.rb
dynflow-1.1.3 lib/dynflow/testing/dummy_executor.rb
dynflow-1.1.2 lib/dynflow/testing/dummy_executor.rb
dynflow-1.1.1 lib/dynflow/testing/dummy_executor.rb
dynflow-1.1.0 lib/dynflow/testing/dummy_executor.rb
dynflow-1.0.5 lib/dynflow/testing/dummy_executor.rb
dynflow-1.0.4 lib/dynflow/testing/dummy_executor.rb
dynflow-1.0.3 lib/dynflow/testing/dummy_executor.rb
dynflow-1.0.2 lib/dynflow/testing/dummy_executor.rb
dynflow-1.0.1 lib/dynflow/testing/dummy_executor.rb
dynflow-1.0.0 lib/dynflow/testing/dummy_executor.rb
dynflow-0.8.37 lib/dynflow/testing/dummy_executor.rb
dynflow-0.8.36 lib/dynflow/testing/dummy_executor.rb
dynflow-0.8.35 lib/dynflow/testing/dummy_executor.rb
dynflow-0.8.34 lib/dynflow/testing/dummy_executor.rb
dynflow-0.8.33 lib/dynflow/testing/dummy_executor.rb
dynflow-0.8.32 lib/dynflow/testing/dummy_executor.rb
dynflow-0.8.31 lib/dynflow/testing/dummy_executor.rb