weel 1.99.103 → 1.99.105

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 +66 -1
  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: 7bc4118f9af75b1f635758821fc31af172b7f02151bc0a05902999123885754d
4
- data.tar.gz: '09c0d3b3de4f1810ed59e4debc90a8f734fa3cdf634bd623eb79a75191ece2bf'
3
+ metadata.gz: 36eb4b85ca61d7f3581ed326a038ded4e7efcebfb07df13f5d449d3e4b60784f
4
+ data.tar.gz: 655750bd2f7ba16c7951eb0d93c111f06788193120a445478108d16d6a9a35ac
5
5
  SHA512:
6
- metadata.gz: 0b0d10b86028537026755946a1dc5969ed5b9fb93b10a5a914f09f7cf3d2343f52d5f0875dc2caffa757eb62cdce0414511b0f90514ae6854b9a812583ebfa1d
7
- data.tar.gz: a3754737a7bab106885e47cfe7968ee0ed2fbc8db637f08aad6ed35dba102cb71d171618da98e1cb99c35ab23adb430f2425aa7f99a0f74b83db4d677b6fe019
6
+ metadata.gz: 1e60b5ea0829d5507f61599a917473eaa51b4fe5fb7f786c377ee8005a2fcf6ae295875729c634588815e1ad76f0fb46058b332b5a0b55528b7030f6d911b7e5
7
+ data.tar.gz: ae3b62411608b8725e734900520e7a42d99559852d131f24609699b72cdbbfa6f2d845ddcfa17c4a03a9bf3ab906da8911c36c71cdf0d27d40189f40c85c84f9
data/lib/weel.rb CHANGED
@@ -263,6 +263,48 @@ class WEEL
263
263
  end
264
264
  end # }}}
265
265
 
266
+ class ReadOnlyHash # {{{
267
+ def initialize(values,sim=false)
268
+ @__weel_values = values.transform_values do |v|
269
+ if Object.const_defined?(:XML) && XML.const_defined?(:Smart) && v.is_a?(XML::Smart::Dom)
270
+ v.root.to_doc
271
+ else
272
+ begin
273
+ Marshal.load(Marshal.dump(v))
274
+ rescue
275
+ v.to_s rescue nil
276
+ end
277
+ end
278
+ end
279
+ @__weel_sim = sim
280
+ end
281
+
282
+ def to_json(*args)
283
+ @__weel_values.to_json(*args)
284
+ end
285
+
286
+ def method_missing(name,*args)
287
+ if @__weel_sim
288
+ "➤#{name}"
289
+ else
290
+ if args.empty? && @__weel_values.key?(name)
291
+ @__weel_values[name]
292
+ elsif args.empty? && @__weel_values.key?(name.to_s)
293
+ @__weel_values[name.to_s]
294
+ elsif name.to_s[-1..-1] == "=" && args.length == 1
295
+ temp = name.to_s[0..-2]
296
+ @__weel_values[temp.to_sym] = args[0]
297
+ elsif name.to_s == "[]=" && args.length == 2
298
+ @__weel_values[args[0]] = args[1]
299
+ elsif name.to_s == "[]" && args.length == 1
300
+ @__weel_values[args[0]]
301
+ else
302
+ nil
303
+ end
304
+ end
305
+ end
306
+ end # }}}
307
+
266
308
  class ConnectionWrapperBase # {{{
267
309
  def self::loop_guard(arguments,lid,count); false; end
268
310
  def self::inform_state_change(arguments,newstate); end
@@ -304,6 +346,7 @@ class WEEL
304
346
  def mem_guard; end
305
347
 
306
348
  def test_condition(mr,code); mr.instance_eval(code); end
349
+ def join_branches(branches); end
307
350
  def manipulate(mr,code,where,result=nil,options=nil); mr.instance_eval(code,where,1); end
308
351
  end # }}}
309
352
 
@@ -437,6 +480,8 @@ class WEEL
437
480
  return if self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped
438
481
 
439
482
  Thread.current[:branches] = []
483
+ Thread.current[:branch_traces] = {}
484
+ Thread.current[:branch_traces_ids] = 0
440
485
  Thread.current[:branch_finished_count] = 0
441
486
  Thread.current[:branch_event] = Continue.new
442
487
  Thread.current[:mutex] = Mutex.new
@@ -465,6 +510,9 @@ class WEEL
465
510
 
466
511
  __weel_sim_stop(:parallel,hw,pos) if __weel_sim
467
512
 
513
+ cw = @__weel_connectionwrapper.new @__weel_connectionwrapper_args
514
+ cw.join_branches(Thread.current[:branch_traces])
515
+
468
516
  unless self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped
469
517
  # first set all to no_longer_neccessary
470
518
  Thread.current[:branches].each do |thread|
@@ -496,6 +544,10 @@ class WEEL
496
544
  Thread.current[:branch_parent] = branch_parent
497
545
  Thread.current[:start_event] = Continue.new
498
546
  Thread.current[:branch_wait_count_cancel_active] = false
547
+ branch_parent[:mutex].synchronize do
548
+ Thread.current[:branch_traces_id] = branch_parent[:branch_traces_ids]
549
+ branch_parent[:branch_traces_ids] += 1
550
+ end
499
551
 
500
552
  if __weel_sim
501
553
  Thread.current[:branch_sim_pos] = @__weel_sim += 1
@@ -668,6 +720,13 @@ class WEEL
668
720
  searchmode = __weel_is_in_search_mode(position)
669
721
  return if searchmode
670
722
  return if self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
723
+
724
+ # gather traces in threads to point to join
725
+ if Thread.current[:branch_parent] && Thread.current[:branch_traces_id]
726
+ Thread.current[:branch_parent][:branch_traces][Thread.current[:branch_traces_id]] ||= []
727
+ Thread.current[:branch_parent][:branch_traces][Thread.current[:branch_traces_id]] << position
728
+ end
729
+
671
730
  __weel_progress position, true
672
731
  self.__weel_state = :stopping
673
732
  end #}}}
@@ -676,7 +735,7 @@ class WEEL
676
735
  @__weel_status
677
736
  end # }}}
678
737
  def data # {{{
679
- ReadHash.new(@__weel_data,__weel_sim)
738
+ ReadOnlyHash.new(@__weel_data,__weel_sim)
680
739
  end # }}}
681
740
  def endpoints # {{{
682
741
  ReadHash.new(@__weel_endpoints)
@@ -765,6 +824,12 @@ class WEEL
765
824
  return
766
825
  end
767
826
 
827
+ # gather traces in threads to point to join
828
+ if Thread.current[:branch_parent] && Thread.current[:branch_traces_id]
829
+ Thread.current[:branch_parent][:branch_traces][Thread.current[:branch_traces_id]] ||= []
830
+ Thread.current[:branch_parent][:branch_traces][Thread.current[:branch_traces_id]] << position
831
+ end
832
+
768
833
  wp = __weel_progress position
769
834
 
770
835
  # searchmode position is after, jump directly to vote_sync_after
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.103"
3
+ s.version = "1.99.105"
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.103
4
+ version: 1.99.105
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: 2022-11-07 00:00:00.000000000 Z
12
+ date: 2023-02-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  requirements: []
104
- rubygems_version: 3.3.7
104
+ rubygems_version: 3.3.26
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: Workflow Execution Engine Library (WEEL)