weel 1.99.91 → 1.99.96

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/weel.rb +21 -14
  3. data/weel.gemspec +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb12e6e8a41ba9cd26f4ca0bc599988506df0b95cbc6cc73268feaa24aef97c1
4
- data.tar.gz: ede8c709b88e40a901a43e7f74e35a537a36d92fbc0962476f0945a5a4bfc905
3
+ metadata.gz: d57273f8a41035b63f07d1d3539c73460c14f66d15c127a2d03b0084ab5990ea
4
+ data.tar.gz: ebcc6596ec5179ceb57166bf9cd5e174ff11cce119bda6834ef1f6faf3b15b1c
5
5
  SHA512:
6
- metadata.gz: c5be98c67503b070738dba25f7328f9d56449f413fbac4be9987d65490f8f9bf08321ca3857cad2d1497b29fbd641dbc744c7578d6f7779480562c1de5098750
7
- data.tar.gz: fe8dc90c3edcb5473a41127fd89beff210042f0cc579d2ebd89c49f3ea30e809d4f010543b6c844c3c61597e4f169f842b3ec7141bddc175a24c677ba31ab49e
6
+ metadata.gz: 59417172655d756d29c40a8d7fc4101baad460c53667823671fe3dd7379e9157ee6310f99029d6e08b808f134819f4e9af1a0eab6e8e5c272b6b02765ca9e8fb
7
+ data.tar.gz: 4ce71748c9925987e7d2acc8188a913ed7d2c7f24d2db7e21d5f75e21065df3e270ae8311ccac58d768f147f564f4cb66177a1c26402e81f554da43d3b412787
@@ -238,7 +238,7 @@ class WEEL
238
238
  end # }}}
239
239
 
240
240
  class HandlerWrapperBase # {{{
241
- def self::loop_guard(lid,count); false; end
241
+ def self::loop_guard(arguments,lid,count); false; end
242
242
  def self::inform_state_change(arguments,newstate); end
243
243
  def self::inform_syntax_error(arguments,err,code); end
244
244
  def self::inform_handlerwrapper_error(arguments,err); end
@@ -636,7 +636,7 @@ class WEEL
636
636
  searchmode = __weel_is_in_search_mode(position)
637
637
  return if searchmode
638
638
  return if self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
639
- __weel_progress searchmode, position, true
639
+ __weel_progress position, true
640
640
  self.__weel_state = :stopping
641
641
  end #}}}
642
642
 
@@ -681,8 +681,9 @@ class WEEL
681
681
  end
682
682
  end #}}}
683
683
 
684
- def __weel_progress(searchmode, position, skip=false) #{{{
684
+ def __weel_progress(position, skip=false) #{{{
685
685
  ipc = {}
686
+ branch = Thread.current
686
687
  if Thread.current[:branch_parent] && Thread.current[:branch_parent][:branch_position]
687
688
  @__weel_positions.delete Thread.current[:branch_parent][:branch_position]
688
689
  ipc[:unmark] ||= []
@@ -694,9 +695,15 @@ class WEEL
694
695
  ipc[:unmark] ||= []
695
696
  ipc[:unmark] << Thread.current[:branch_position] rescue nil
696
697
  end
697
- wp = WEEL::Position.new(position, skip ? :after : :at, nil)
698
+ wp = if branch[:branch_search_now] == true
699
+ branch[:branch_search_now] = false
700
+ WEEL::Position.new(position, skip ? :after : :at, @__weel_search_positions[position]&.passthrough)
701
+ else
702
+ WEEL::Position.new(position, skip ? :after : :at)
703
+ end
698
704
  ipc[skip ? :after : :at] = [wp]
699
705
 
706
+ @__weel_search_positions.delete(position)
700
707
  @__weel_search_positions.each do |k,ele| # some may still be in active search but lets unmark them for good measure
701
708
  ipc[:unmark] ||= []
702
709
  ipc[:unmark] << ele
@@ -726,7 +733,7 @@ class WEEL
726
733
  return
727
734
  end
728
735
 
729
- wp = __weel_progress searchmode, position
736
+ wp = __weel_progress position
730
737
 
731
738
  # searchmode position is after, jump directly to vote_sync_after
732
739
  raise Signal::Proceed if searchmode == :after
@@ -772,13 +779,7 @@ class WEEL
772
779
  raise Signal::Stop unless handlerwrapper.vote_sync_before(params)
773
780
  raise Signal::Skip if self.__weel_state == :stopping || self.__weel_state == :finishing
774
781
 
775
- if @__weel_search_positions[position]
776
- passthrough = @__weel_search_positions[position].passthrough
777
- @__weel_search_positions[position].passthrough = nil
778
- else
779
- passthrough = nil
780
- end
781
- handlerwrapper.activity_handle passthrough, params
782
+ handlerwrapper.activity_handle wp.passthrough, params
782
783
  wp.passthrough = handlerwrapper.activity_passthrough_value
783
784
  unless wp.passthrough.nil?
784
785
  @__weel_handlerwrapper::inform_position_change @__weel_handlerwrapper_args, :wait => [wp]
@@ -923,9 +924,11 @@ class WEEL
923
924
 
924
925
  if position && @__weel_search_positions.include?(position) # matching searchpos => start execution from here
925
926
  branch[:branch_search] = false # execute all activities in THIS branch (thread) after this point
927
+ branch[:branch_search_now] = true # just now did we switch the search mode
926
928
  while branch.key?(:branch_parent) # also all parent branches should execute activities after this point, additional branches spawned by parent branches should still be in search mode
927
929
  branch = branch[:branch_parent]
928
930
  branch[:branch_search] = false
931
+ branch[:branch_search_now] = true # just now did we switch the search mode
929
932
  end
930
933
  @__weel_search_positions[position].detail == :after
931
934
  else
@@ -1101,8 +1104,12 @@ public
1101
1104
  # Stop the workflow execution
1102
1105
  def stop # {{{
1103
1106
  Thread.new do
1104
- @dslr.__weel_state = :stopping
1105
- @dslr.__weel_main.join if @dslr.__weel_main
1107
+ if @dslr.__weel_state == :running
1108
+ @dslr.__weel_state = :stopping
1109
+ @dslr.__weel_main.join if @dslr.__weel_main
1110
+ elsif @dslr.__weel_state == :ready || @dslr.__weel_state == :stopped
1111
+ @dslr.__weel_state = :stopped
1112
+ end
1106
1113
  end
1107
1114
  end # }}}
1108
1115
  # Start the workflow execution
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "weel"
3
- s.version = "1.99.91"
3
+ s.version = "1.99.96"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "Workflow Execution Engine Library (WEEL)"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.99.91
4
+ version: 1.99.96
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-09-26 00:00:00.000000000 Z
12
+ date: 2020-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit