dynflow 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/termination.rb +26 -0
- data/lib/dynflow/executors/parallel/pool.rb +7 -3
- data/lib/dynflow/executors/parallel/worker.rb +4 -3
- data/lib/dynflow/version.rb +1 -1
- data/lib/dynflow/world.rb +1 -0
- data/web/assets/images/logo-square.png +0 -0
- metadata +3 -2
- data/web/assets/images/logo-square.png +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36610c9601830c752e4cf36716d91b8fc2703d16796d5812e550440a6f0a0b76
|
4
|
+
data.tar.gz: 149131675b4b1f0f2858b4ebd59d3b9ac2fbc74404194c738d3f2ac90944d86d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06bc662c810b038ae134f04550e44b6a5d0d8de46241487d1cb61a7ebc08ba09e9b0f16024ccd0150f2621188afe39197f88cc161dd6814b7dd35a0a9d0de69e
|
7
|
+
data.tar.gz: ab4b95daedddcf60b52af392d83eff308eca24a0ff621bdfd8c7f334fd7268531585bba4df83eba8207a03eaa05efc6d276ffb01435146c2d6b83beacd9f593b
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require_relative 'example_helper'
|
4
|
+
|
5
|
+
class Sleeper < Dynflow::Action
|
6
|
+
def run(event = nil)
|
7
|
+
sleep
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def report(msg)
|
12
|
+
puts "===== #{Time.now}: #{msg}"
|
13
|
+
end
|
14
|
+
|
15
|
+
if $0 == __FILE__
|
16
|
+
ExampleHelper.world.action_logger.level = 1
|
17
|
+
ExampleHelper.world.logger.level = 0
|
18
|
+
|
19
|
+
ExampleHelper.world.trigger(Sleeper)
|
20
|
+
report "Sleeping"
|
21
|
+
sleep 5
|
22
|
+
|
23
|
+
report "Asking to terminate"
|
24
|
+
ExampleHelper.world.terminate.wait
|
25
|
+
report "Terminated"
|
26
|
+
end
|
@@ -95,10 +95,14 @@ module Dynflow
|
|
95
95
|
private
|
96
96
|
|
97
97
|
def try_to_terminate
|
98
|
-
if terminating?
|
98
|
+
if terminating?
|
99
99
|
@free_workers.map { |worker| worker.ask(:terminate!) }.map(&:wait)
|
100
|
-
@
|
101
|
-
|
100
|
+
@pool_size -= @free_workers.count
|
101
|
+
@free_workers = []
|
102
|
+
if @pool_size.zero?
|
103
|
+
@executor_core.tell([:finish_termination, @name])
|
104
|
+
finish_termination
|
105
|
+
end
|
102
106
|
end
|
103
107
|
end
|
104
108
|
|
@@ -9,16 +9,17 @@ module Dynflow
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def on_message(work_item)
|
12
|
-
|
12
|
+
ok = false
|
13
13
|
Executors.run_user_code do
|
14
14
|
work_item.execute
|
15
|
+
ok = true
|
15
16
|
end
|
16
17
|
rescue Errors::PersistenceError => e
|
17
18
|
@pool.tell([:handle_persistence_error, reference, e, work_item])
|
18
|
-
|
19
|
+
ok = false
|
19
20
|
ensure
|
20
21
|
Dynflow::Telemetry.with_instance { |t| t.increment_counter(:dynflow_worker_events, 1, @telemetry_options) }
|
21
|
-
@pool.tell([:worker_done, reference, work_item])
|
22
|
+
@pool.tell([:worker_done, reference, work_item]) if ok
|
22
23
|
end
|
23
24
|
end
|
24
25
|
end
|
data/lib/dynflow/version.rb
CHANGED
data/lib/dynflow/world.rb
CHANGED
Binary file
|
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.
|
4
|
+
version: 1.1.4
|
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
|
+
date: 2018-12-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -379,6 +379,7 @@ files:
|
|
379
379
|
- examples/singletons.rb
|
380
380
|
- examples/sub_plan_concurrency_control.rb
|
381
381
|
- examples/sub_plans.rb
|
382
|
+
- examples/termination.rb
|
382
383
|
- extras/statsd_mapping.conf
|
383
384
|
- lib/dynflow.rb
|
384
385
|
- lib/dynflow/action.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
web/assets/images/../../../doc/pages/source/images/logo-square.png
|