dynflow 1.1.6 → 1.2.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/dynflow.gemspec +2 -2
  4. data/examples/clock_benchmark.rb +35 -0
  5. data/examples/memory_limit_watcher.rb +1 -1
  6. data/lib/dynflow/action.rb +2 -2
  7. data/lib/dynflow/action/suspended.rb +1 -1
  8. data/lib/dynflow/action/with_sub_plans.rb +1 -1
  9. data/lib/dynflow/actor.rb +2 -2
  10. data/lib/dynflow/actors/execution_plan_cleaner.rb +1 -1
  11. data/lib/dynflow/clock.rb +11 -8
  12. data/lib/dynflow/delayed_executors/abstract.rb +1 -1
  13. data/lib/dynflow/delayed_plan.rb +1 -1
  14. data/lib/dynflow/director.rb +4 -4
  15. data/lib/dynflow/director/execution_plan_manager.rb +2 -2
  16. data/lib/dynflow/director/running_steps_manager.rb +4 -4
  17. data/lib/dynflow/dispatcher/client_dispatcher.rb +13 -12
  18. data/lib/dynflow/dispatcher/executor_dispatcher.rb +5 -5
  19. data/lib/dynflow/execution_plan.rb +1 -1
  20. data/lib/dynflow/execution_plan/steps/plan_step.rb +4 -2
  21. data/lib/dynflow/executors/abstract.rb +6 -6
  22. data/lib/dynflow/executors/parallel.rb +6 -6
  23. data/lib/dynflow/executors/parallel/core.rb +1 -1
  24. data/lib/dynflow/rails/daemon.rb +1 -1
  25. data/lib/dynflow/testing/dummy_executor.rb +2 -2
  26. data/lib/dynflow/testing/dummy_world.rb +1 -1
  27. data/lib/dynflow/testing/in_thread_executor.rb +5 -5
  28. data/lib/dynflow/testing/in_thread_world.rb +6 -6
  29. data/lib/dynflow/throttle_limiter.rb +5 -5
  30. data/lib/dynflow/utils.rb +3 -140
  31. data/lib/dynflow/utils/indifferent_hash.rb +143 -0
  32. data/lib/dynflow/utils/priority_queue.rb +64 -0
  33. data/lib/dynflow/version.rb +1 -1
  34. data/lib/dynflow/world.rb +22 -22
  35. data/lib/dynflow/world/invalidation.rb +1 -1
  36. data/test/batch_sub_tasks_test.rb +4 -4
  37. data/test/concurrency_control_test.rb +6 -6
  38. data/test/daemon_test.rb +2 -2
  39. data/test/dispatcher_test.rb +6 -6
  40. data/test/execution_plan_test.rb +11 -0
  41. data/test/executor_test.rb +1 -1
  42. data/test/support/dummy_example.rb +1 -1
  43. data/test/test_helper.rb +17 -17
  44. data/test/utils_test.rb +56 -0
  45. data/test/world_test.rb +2 -2
  46. metadata +14 -9
@@ -0,0 +1,56 @@
1
+ require_relative 'test_helper'
2
+
3
+ module Dynflow
4
+ module UtilsTest
5
+ describe ::Dynflow::Utils::PriorityQueue do
6
+ let(:queue) { Utils::PriorityQueue.new }
7
+
8
+ it 'can insert elements' do
9
+ queue.push 1
10
+ queue.top.must_equal 1
11
+ queue.push 2
12
+ queue.top.must_equal 2
13
+ queue.push 3
14
+ queue.top.must_equal 3
15
+ queue.to_a.must_equal [1, 2, 3]
16
+ end
17
+
18
+ it 'can override the comparator' do
19
+ queue = Utils::PriorityQueue.new { |a, b| b <=> a }
20
+ queue.push 1
21
+ queue.top.must_equal 1
22
+ queue.push 2
23
+ queue.top.must_equal 1
24
+ queue.push 3
25
+ queue.top.must_equal 1
26
+ queue.to_a.must_equal [3, 2, 1]
27
+ end
28
+
29
+ it 'can inspect top element without removing it' do
30
+ queue.top.must_be_nil
31
+ queue.push(1)
32
+ queue.top.must_equal 1
33
+ queue.push(3)
34
+ queue.top.must_equal 3
35
+ queue.push(2)
36
+ queue.top.must_equal 3
37
+ end
38
+
39
+ it 'can report size' do
40
+ count = 5
41
+ count.times { queue.push 1 }
42
+ queue.size.must_equal count
43
+ end
44
+
45
+ it 'pops elements in correct order' do
46
+ queue.push 1
47
+ queue.push 3
48
+ queue.push 2
49
+ queue.pop.must_equal 3
50
+ queue.pop.must_equal 2
51
+ queue.pop.must_equal 1
52
+ queue.pop.must_equal nil
53
+ end
54
+ end
55
+ end
56
+ end
@@ -41,12 +41,12 @@ module Dynflow
41
41
  describe '#terminate' do
42
42
  it 'fires an event after termination' do
43
43
  terminated_event = world.terminated
44
- terminated_event.completed?.must_equal false
44
+ terminated_event.resolved?.must_equal false
45
45
  world.terminate
46
46
  # wait for termination process to finish, but don't block
47
47
  # the test from running.
48
48
  terminated_event.wait(10)
49
- terminated_event.completed?.must_equal true
49
+ terminated_event.resolved?.must_equal true
50
50
  end
51
51
  end
52
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.2.0.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Necas
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-12-13 00:00:00.000000000 Z
12
+ date: 2018-12-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -59,28 +59,28 @@ dependencies:
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: 1.0.0
62
+ version: 1.1.3
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: 1.0.0
69
+ version: 1.1.3
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: concurrent-ruby-edge
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: 0.2.0
76
+ version: 0.4.1
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: 0.2.0
83
+ version: 0.4.1
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: sequel
86
86
  requirement: !ruby/object:Gem::Requirement
@@ -370,6 +370,7 @@ files:
370
370
  - doc/pages/source/media/index.md
371
371
  - doc/pages/source/projects/index.md
372
372
  - dynflow.gemspec
373
+ - examples/clock_benchmark.rb
373
374
  - examples/example_helper.rb
374
375
  - examples/future_execution.rb
375
376
  - examples/memory_limit_watcher.rb
@@ -524,6 +525,8 @@ files:
524
525
  - lib/dynflow/transaction_adapters/active_record.rb
525
526
  - lib/dynflow/transaction_adapters/none.rb
526
527
  - lib/dynflow/utils.rb
528
+ - lib/dynflow/utils/indifferent_hash.rb
529
+ - lib/dynflow/utils/priority_queue.rb
527
530
  - lib/dynflow/version.rb
528
531
  - lib/dynflow/watchers/memory_consumption_watcher.rb
529
532
  - lib/dynflow/web.rb
@@ -564,6 +567,7 @@ files:
564
567
  - test/support/test_execution_log.rb
565
568
  - test/test_helper.rb
566
569
  - test/testing_test.rb
570
+ - test/utils_test.rb
567
571
  - test/web_console_test.rb
568
572
  - test/world_test.rb
569
573
  - web/assets/images/logo-square.png
@@ -606,12 +610,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
606
610
  version: 2.0.0
607
611
  required_rubygems_version: !ruby/object:Gem::Requirement
608
612
  requirements:
609
- - - ">="
613
+ - - ">"
610
614
  - !ruby/object:Gem::Version
611
- version: '0'
615
+ version: 1.3.1
612
616
  requirements: []
613
617
  rubyforge_project:
614
- rubygems_version: 2.7.6
618
+ rubygems_version: 2.7.3
615
619
  signing_key:
616
620
  specification_version: 4
617
621
  summary: DYNamic workFLOW engine
@@ -646,5 +650,6 @@ test_files:
646
650
  - test/support/test_execution_log.rb
647
651
  - test/test_helper.rb
648
652
  - test/testing_test.rb
653
+ - test/utils_test.rb
649
654
  - test/web_console_test.rb
650
655
  - test/world_test.rb