weel 1.99.128 → 1.99.130

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 +72 -63
  3. data/weel.gemspec +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db2306d1398c142ad06651d1a9db48e0c9a4943133f9bd6571b5bc2471a0c2a2
4
- data.tar.gz: c181a1d7ef50b406e97dbefff98d3cd326323c3aaf77e87605ab2c6eeae3397d
3
+ metadata.gz: a65829729d2a2508096cec3ee8ab6ee5abbd32d718cc50a4b2c68fc5632728bc
4
+ data.tar.gz: 4c1a71c7a48f37a41fe99c8b79f70adc2fa175f44635ead7694c7d3a5a4865ba
5
5
  SHA512:
6
- metadata.gz: 92d0c335a5e58548963d9e5fa22ef985534670bc26f077636065f558ffb159210b38e27b6262f2ba0dffe45c8f593d8e905315ca6cafd09c72d9c38cdcbea267
7
- data.tar.gz: d65d56e15a65ccbb609e5a205743a59dbede363d4b3772432a5ee04a1ecc39e2f4402dce911f1a0922aa3b166a5e037b88f1f2ec1fc982386d20be15f9c2c0b7
6
+ metadata.gz: f6f771194196936be9d5b82fe7995fdf432bc61a59abfc51b004cd214a2b9738947e8eb90ef23bc0558dc5871d772358bff92109a21afa9cae18a303584dcfae
7
+ data.tar.gz: 5df275e55141dc2beb82530b968b0afa004985466f829acb59d7d48debb23f02180b96ddf2c6fb1dd0327049a61b0321a23dce67d8d7de42177ab524a2492482
data/lib/weel.rb CHANGED
@@ -355,9 +355,8 @@ class WEEL
355
355
  def activity_passthrough_value; end
356
356
  def activity_uuid; '42424242-cpee-cpee-cpee-424242424242'; end
357
357
 
358
- def activity_no_longer_necessary; end
359
-
360
358
  def inform_activity_done; end
359
+ def inform_activity_cancelled; end
361
360
  def inform_activity_manipulate; end
362
361
  def inform_activity_failed(err); end
363
362
  def inform_manipulate_change(status,changed_data,changed_endpoints,data,endpoints); end
@@ -380,8 +379,8 @@ class WEEL
380
379
  end
381
380
  end
382
381
 
383
- def join_branches(branches); end
384
- def split_branches(branches); end
382
+ def join_branches(id,branches=[]); end
383
+ def split_branches(id,branches=[]); end
385
384
  end # }}}
386
385
 
387
386
  class Position # {{{
@@ -534,7 +533,7 @@ class WEEL
534
533
  end
535
534
 
536
535
  cw = @__weel_connectionwrapper.new @__weel_connectionwrapper_args
537
- cw.split_branches(Thread.current[:branch_traces])
536
+ cw.split_branches Thread.current.__id__, Thread.current[:branch_traces]
538
537
 
539
538
  Thread.current[:branches].each do |thread|
540
539
  # decide after executing block in parallel cause for coopis
@@ -547,7 +546,7 @@ class WEEL
547
546
 
548
547
  Thread.current[:branch_event].wait unless self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:branches].length == 0
549
548
 
550
- cw.join_branches(Thread.current[:branch_traces])
549
+ cw.join_branches Thread.current.__id__, Thread.current[:branch_traces]
551
550
 
552
551
  unless self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped
553
552
  # first set all to no_longer_neccessary, just in case, but this should not be necessary
@@ -635,9 +634,11 @@ class WEEL
635
634
  Thread.current[:alternative_mode] << mode
636
635
 
637
636
  cw = @__weel_connectionwrapper.new @__weel_connectionwrapper_args
638
- cw.split_branches(Thread.current[:branch_traces])
639
637
 
638
+ cw.split_branches Thread.current.__id__
640
639
  __weel_protect_yield(&block)
640
+ cw.join_branches Thread.current.__id__
641
+
641
642
  Thread.current[:alternative_executed].pop
642
643
  Thread.current[:alternative_mode].pop
643
644
  nil
@@ -875,70 +876,77 @@ class WEEL
875
876
  @__weel_connectionwrapper::inform_position_change @__weel_connectionwrapper_args, :after => [wp]
876
877
  end
877
878
  when :call
878
- again = catch Signal::Again do # Will be nil if we do not throw (using default connectionwrapper)
879
- connectionwrapper.mem_guard
880
- params = connectionwrapper.prepare(@__weel_lock,@__weel_data,@__weel_endpoints,@__weel_status,Thread.current[:local],connectionwrapper.additional,prepare,endpoint,parameters)
881
-
882
- raise Signal::Stop unless connectionwrapper.vote_sync_before(params)
883
- raise Signal::Skip if self.__weel_state == :stopping || self.__weel_state == :finishing
884
-
885
- connectionwrapper.activity_handle wp.passthrough, params
886
- wp.passthrough = connectionwrapper.activity_passthrough_value
887
- unless wp.passthrough.nil?
888
- @__weel_connectionwrapper::inform_position_change @__weel_connectionwrapper_args, :wait => [wp]
889
- end
890
- begin
891
- # cleanup after callback updates
879
+ begin
880
+ again = catch Signal::Again do # Will be nil if we do not throw (using default connectionwrapper)
892
881
  connectionwrapper.mem_guard
882
+ params = connectionwrapper.prepare(@__weel_lock,@__weel_data,@__weel_endpoints,@__weel_status,Thread.current[:local],connectionwrapper.additional,prepare,endpoint,parameters)
893
883
 
894
- # with loop if catching Signal::Again
895
- # handshake call and wait until it finished
896
- waitingresult = nil
897
- waitingresult = Thread.current[:continue].wait unless Thread.current[:nolongernecessary] || self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped
884
+ raise Signal::Stop unless connectionwrapper.vote_sync_before(params)
885
+ raise Signal::Skip if self.__weel_state == :stopping || self.__weel_state == :finishing
898
886
 
899
- if Thread.current[:nolongernecessary]
900
- connectionwrapper.activity_no_longer_necessary
901
- raise Signal::NoLongerNecessary
902
- end
903
- if self.__weel_state == :stopping || self.__weel_state == :finishing
904
- connectionwrapper.activity_stop
905
- wp.passthrough = connectionwrapper.activity_passthrough_value
906
- raise Signal::Proceed if wp.passthrough # if stop, but no passthrough, let manipulate happen and then stop
887
+ connectionwrapper.activity_handle wp.passthrough, params
888
+ wp.passthrough = connectionwrapper.activity_passthrough_value
889
+ unless wp.passthrough.nil?
890
+ @__weel_connectionwrapper::inform_position_change @__weel_connectionwrapper_args, :wait => [wp]
907
891
  end
892
+ begin
893
+ # cleanup after callback updates
894
+ connectionwrapper.mem_guard
908
895
 
909
- next if waitingresult == WEEL::Signal::UpdateAgain && connectionwrapper.activity_result_value&.length == 0
896
+ # with loop if catching Signal::Again
897
+ # handshake call and wait until it finished
898
+ waitingresult = nil
899
+ waitingresult = Thread.current[:continue].wait unless Thread.current[:nolongernecessary] || self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped
900
+
901
+ if Thread.current[:nolongernecessary]
902
+ raise Signal::NoLongerNecessary
903
+ end
904
+ if self.__weel_state == :stopping || self.__weel_state == :finishing
905
+ connectionwrapper.activity_stop
906
+ wp.passthrough = connectionwrapper.activity_passthrough_value
907
+ raise Signal::Proceed if wp.passthrough # if stop, but no passthrough, let manipulate happen and then stop
908
+ end
909
+
910
+ next if waitingresult == WEEL::Signal::UpdateAgain && connectionwrapper.activity_result_value&.length == 0
911
+
912
+ code, cmess = if waitingresult == WEEL::Signal::UpdateAgain
913
+ [update, 'update']
914
+ elsif waitingresult == WEEL::Signal::Salvage
915
+ if salvage
916
+ [salvage, 'salvage']
917
+ else
918
+ raise('HTTP Error. The service return status was not between 200 and 300.')
919
+ end
920
+ else
921
+ [finalize, 'finalize']
922
+ end
923
+ if code.is_a?(String)
924
+ connectionwrapper.inform_activity_manipulate
925
+ struct = nil
926
+
927
+ # when you throw without parameters, ma contains nil, so we return Signal::Proceed to give ma a meaningful value in other cases
928
+ ma = catch Signal::Again do
929
+ struct = connectionwrapper.manipulate(false,@__weel_lock,@__weel_data,@__weel_endpoints,@__weel_status,Thread.current[:local],connectionwrapper.additional,code,'Activity ' + position.to_s + ' ' + cmess,connectionwrapper.activity_result_value,connectionwrapper.activity_result_options)
930
+ Signal::Proceed
931
+ end
932
+ connectionwrapper.inform_manipulate_change(
933
+ ((struct && struct.changed_status) ? @__weel_status : nil),
934
+ ((struct && struct.changed_data.any?) ? struct.changed_data.uniq : nil),
935
+ ((struct && struct.changed_endpoints.any?) ? struct.changed_endpoints.uniq : nil),
936
+ @__weel_data,
937
+ @__weel_endpoints
938
+ )
939
+ throw(Signal::Again, Signal::Again) if ma.nil? || ma == Signal::Again # this signal again loops "there is a catch" because rescue signal throw that throughly restarts the task
940
+ else
910
941
 
911
- code, cmess = if waitingresult == WEEL::Signal::UpdateAgain
912
- [update, 'update']
913
- elsif waitingresult == WEEL::Signal::Salvage
914
- [salvage, 'salvage'] || raise('HTTP Error. The service return status was not between 200 and 300.')
915
- else
916
- [finalize, 'finalize']
917
- end
918
- if code.is_a?(String)
919
- connectionwrapper.inform_activity_manipulate
920
- struct = nil
921
-
922
- # when you throw without parameters, ma contains nil, so we return Signal::Proceed to give ma a meaningful value in other cases
923
- ma = catch Signal::Again do
924
- struct = connectionwrapper.manipulate(false,@__weel_lock,@__weel_data,@__weel_endpoints,@__weel_status,Thread.current[:local],connectionwrapper.additional,code,'Activity ' + position.to_s + ' ' + cmess,connectionwrapper.activity_result_value,connectionwrapper.activity_result_options)
925
- Signal::Proceed
926
942
  end
927
- connectionwrapper.inform_manipulate_change(
928
- ((struct && struct.changed_status) ? @__weel_status : nil),
929
- ((struct && struct.changed_data.any?) ? struct.changed_data.uniq : nil),
930
- ((struct && struct.changed_endpoints.any?) ? struct.changed_endpoints.uniq : nil),
931
- @__weel_data,
932
- @__weel_endpoints
933
- )
934
- throw(Signal::Again, Signal::Again) if ma.nil? || ma == Signal::Again # this signal again loops "there is a catch" because rescue signal throw that throughly restarts the task
943
+ end while waitingresult == Signal::UpdateAgain # this signal again loops because async update, proposal: rename to UpdateAgain
944
+ if connectionwrapper.activity_passthrough_value.nil?
945
+ connectionwrapper.inform_activity_done
946
+ wp.passthrough = nil
947
+ wp.detail = :after
948
+ @__weel_connectionwrapper::inform_position_change @__weel_connectionwrapper_args, :after => [wp]
935
949
  end
936
- end while waitingresult == Signal::UpdateAgain # this signal again loops because async update, proposal: rename to UpdateAgain
937
- if connectionwrapper.activity_passthrough_value.nil?
938
- connectionwrapper.inform_activity_done
939
- wp.passthrough = nil
940
- wp.detail = :after
941
- @__weel_connectionwrapper::inform_position_change @__weel_connectionwrapper_args, :after => [wp]
942
950
  end
943
951
  end while again == Signal::Again # there is a catch
944
952
  end
@@ -949,6 +957,7 @@ class WEEL
949
957
  wp.detail = :unmark
950
958
  end
951
959
  rescue Signal::NoLongerNecessary
960
+ connectionwrapper.inform_activity_cancelled
952
961
  connectionwrapper.inform_activity_done
953
962
  @__weel_positions.delete wp
954
963
  Thread.current[:branch_position] = nil
data/weel.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "weel"
3
- s.version = "1.99.128"
3
+ s.version = "1.99.130"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0-or-later"
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.128
4
+ version: 1.99.130
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: 2024-09-23 00:00:00.000000000 Z
12
+ date: 2024-10-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  requirements: []
103
- rubygems_version: 3.5.11
103
+ rubygems_version: 3.5.16
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: Workflow Execution Engine Library (WEEL)