task-orchestrator 0.0.28 → 0.0.29

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dac079f06844039fa1e51a03e31b10860f3c4ca7
4
- data.tar.gz: 40618536ca5c2cfb527e8e6429220ac84273778a
3
+ metadata.gz: 7627c23f7d1208e1ddd2a3fa32fd9276e7ab2132
4
+ data.tar.gz: 79b1fc621bd668c1e92d35315b06b863b66f6228
5
5
  SHA512:
6
- metadata.gz: c500e9d51a3b17b921dbf6eb9507f3af121b46165aa2049ce16f7ed4d9a6fb073a827a3919905e7a5dd4fa5ad38d5dcc2ea7db45d6d009925d9345821213c1c0
7
- data.tar.gz: b1bdc3b8fbfaf7304335f49152f3d9c727d6b98bbb9af7ffb3c9f6569d7015b13d1e6efcb8e8868c242285056c52affbeca016a3c9c82ba1714402ae364db5ae
6
+ metadata.gz: 7105fddb75b9ce7708e3de2a96d4d9df880ca76059c6ebee82b1915dc02dae1989c351ef0b48787f7b8b8361b9a3fb1c083170b055fc008121b822aec6897235
7
+ data.tar.gz: 9e27ff6cadd9235c3a21111be3167444b8e2f0e806fe0dc9456eba1c7b9d7c8279e090371fbdb8a87c704995d286765e73e27577e8b5e9fa0bb2e00657f9e7cc
data/examples/parallel CHANGED
@@ -14,3 +14,13 @@ orchestrator:
14
14
  - command: echo 3
15
15
  - command: echo 4
16
16
  - command: echo 5
17
+ - type: parallel
18
+ parallel: 3
19
+ parallel_spawn_delay: 2
20
+ sleep: 0.1
21
+ scripts:
22
+ - command: date +%S
23
+ - command: date +%S
24
+ - command: date +%S
25
+ - command: date +%S
26
+ - command: date +%S
@@ -448,6 +448,7 @@ EOF
448
448
  if step['type'].to_sym == :parallel and @on_week_days.map {|d| Time.now.send(d) }.find_index(true) and @on_month_days.find_index(Time.now.mday)
449
449
  #Parallel
450
450
  interval = step.has_key?('sleep') ? step['sleep'] : 1
451
+ parallel_spawn_delay = step.has_key?('parallel_spawn_delay') ? step['parallel_spawn_delay'] : 0.1
451
452
  parallel_factor = step.has_key?('parallel') ? step['parallel'] : 1
452
453
  @on_failure = step.has_key?('on_failure') ? step['on_failure'].to_sym : :finish
453
454
 
@@ -469,6 +470,7 @@ EOF
469
470
  break if @on_failure == :wait and @statuses.find_index(false)
470
471
  if parallel_factor > running_threads
471
472
  @threads[index] = Thread.new { thread_wrapper(index, step['scripts'][index]) }
473
+ sleep parallel_spawn_delay if index < parallel_factor - 1
472
474
  break
473
475
  end
474
476
  sleep interval
@@ -1,3 +1,3 @@
1
1
  module Orchestrator
2
- VERSION ||= '0.0.28'
2
+ VERSION ||= '0.0.29'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: task-orchestrator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.28
4
+ version: 0.0.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Piavlo