weel 1.99.147 → 1.99.148

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/weel.rb +22 -22
  3. data/weel.gemspec +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69f09565a0379192ad8313bef74a41fa04c5b088f8d8422aa2f74608e9ff7f8e
4
- data.tar.gz: 7981eaa92f35eb497354db544616596daff1d31343abd87a2ea313d5db33e6ad
3
+ metadata.gz: e10889ede3a7592b78507a3c2407de7b1ab973e53018daaf383cd9ac6e647a10
4
+ data.tar.gz: 183c98ada1407aebad8784f2be27c3fab044a4ee9c7946f0f425fa04ee6cee38
5
5
  SHA512:
6
- metadata.gz: 015f753c35aab1d566cf8e8d4225776380f5ac52038e1f5cc77affebb30202c4d121bdd5b64e987ee78672f8e5aeb85b74ca36328f96ec8e1db8658797f41412
7
- data.tar.gz: 5c91f64464d1b0dd98a8725017f5eba90319f042c6bcfe73b5fa8711e728d00163e458e72cb80ccba1dc6dd1ed48b450b4cf387e0215984522470dd3c4def355
6
+ metadata.gz: 182e697164ae732c2f75c511a3663dc7a5132edc4788348231f3d5beaf3ce758f69a1f112f4495df4e80a39fbe5ed6a94657f69f53e1627da8154a5559d1162a
7
+ data.tar.gz: '08dbadddd9c6bf1875fe9d9b423e627846a185b5bd3dcb66479f4d32fda3f9daccb4b1e1a02d3e73933a5399811723d2dfab1b56d4c15dfdc3e65eb867601972'
data/lib/weel.rb CHANGED
@@ -374,7 +374,7 @@ class WEEL
374
374
  def mem_guard; end
375
375
 
376
376
  def prepare(lock,dataelements,endpoints,status,local,additional,code,exec_endpoints,exec_parameters); end
377
- def test_condition(dataelements,endpoints,local,additional,code,args={}); ReadStructure.new(dataelements,endpoints,local,additional).instance_eval(code); end
377
+ def test_condition(eid,dataelements,endpoints,local,additional,code,args={}); ReadStructure.new(dataelements,endpoints,local,additional).instance_eval(code); end
378
378
  def manipulate(readonly,lock,dataelements,endpoints,status,local,additional,code,where,result=nil,options=nil)
379
379
  lock.synchronize do
380
380
  if readonly
@@ -385,8 +385,8 @@ class WEEL
385
385
  end
386
386
  end
387
387
 
388
- def join_branches(id,branches=[]); end
389
- def split_branches(id,branches=[]); end
388
+ def join_branches(eid,branches=[]); end
389
+ def split_branches(eid,branches=[]); end
390
390
  end # }}}
391
391
 
392
392
  class Position # {{{
@@ -519,7 +519,7 @@ class WEEL
519
519
  # Parallel DSL-Construct
520
520
  # Defines Workflow paths that can be executed parallel.
521
521
  # May contain multiple branches (parallel_branch)
522
- def parallel(type=nil,&block)# {{{
522
+ def parallel(eid,type=nil,&block)# {{{
523
523
  return if self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
524
524
 
525
525
  Thread.current[:branches] = []
@@ -540,7 +540,7 @@ class WEEL
540
540
  end
541
541
 
542
542
  cw = @__weel_connectionwrapper.new @__weel_connectionwrapper_args
543
- cw.split_branches Thread.current.__id__, Thread.current[:branch_traces]
543
+ cw.split_branches eid, Thread.current[:branch_traces]
544
544
 
545
545
  Thread.current[:branches].each do |thread|
546
546
  # decide after executing block in parallel cause for coopis
@@ -553,7 +553,7 @@ class WEEL
553
553
 
554
554
  Thread.current[:branch_event].wait unless self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:branches].length == 0
555
555
 
556
- cw.join_branches Thread.current.__id__, Thread.current[:branch_traces]
556
+ cw.join_branches eid, Thread.current[:branch_traces]
557
557
 
558
558
  unless self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped
559
559
  # first set all to no_longer_neccessary, just in case, but this should not be necessary
@@ -569,7 +569,7 @@ class WEEL
569
569
  end # }}}
570
570
 
571
571
  # Defines a branch of a parallel-Construct
572
- def parallel_branch(data=@__weel_data,&block)# {{
572
+ def parallel_branch(eid,data=@__weel_data,&block) #{{{
573
573
  return if self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
574
574
  branch_parent = Thread.current
575
575
 
@@ -631,12 +631,12 @@ class WEEL
631
631
  end
632
632
  end
633
633
  end
634
- end # }}}
634
+ end #}}}
635
635
 
636
636
  # Choose DSL-Construct
637
637
  # Defines a choice in the Workflow path.
638
638
  # May contain multiple execution alternatives
639
- def choose(mode=:inclusive,&block) # {{{
639
+ def choose(eid,mode=:inclusive,&block) # {{{
640
640
  return if self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
641
641
  Thread.current[:alternative_executed] ||= []
642
642
  Thread.current[:alternative_mode] ||= []
@@ -645,9 +645,9 @@ class WEEL
645
645
 
646
646
  cw = @__weel_connectionwrapper.new @__weel_connectionwrapper_args
647
647
 
648
- cw.split_branches Thread.current.__id__
648
+ cw.split_branches eid
649
649
  __weel_protect_yield(&block)
650
- cw.join_branches Thread.current.__id__
650
+ cw.join_branches eid
651
651
 
652
652
  Thread.current[:alternative_executed].pop
653
653
  Thread.current[:alternative_mode].pop
@@ -657,13 +657,13 @@ class WEEL
657
657
  # Defines a possible choice of a choose-Construct
658
658
  # Block is executed if condition == true or
659
659
  # searchmode is active (to find the starting position)
660
- def alternative(condition,args={},&block)# {{{
660
+ def alternative(eid,condition,args={},&block)# {{{
661
661
  return if self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
662
662
  Thread.current[:mutex] ||= Mutex.new
663
663
  Thread.current[:mutex].synchronize do
664
664
  return if Thread.current[:alternative_mode][-1] == :exclusive && Thread.current[:alternative_executed][-1] == true
665
665
  if condition.is_a?(String)
666
- condition = __weel_eval_condition(condition, args)
666
+ condition = __weel_eval_condition(eid, condition, args)
667
667
  end
668
668
  Thread.current[:alternative_executed][-1] = true if condition
669
669
  end
@@ -671,7 +671,7 @@ class WEEL
671
671
  __weel_protect_yield(&block) if searchmode || condition
672
672
  Thread.current[:alternative_executed][-1] = true if __weel_is_in_search_mode != searchmode # we swiched from searchmode true to false, thus branch has been executed which is as good as evaling the condition to true
673
673
  end # }}}
674
- def otherwise(args={},&block) # {{{
674
+ def otherwise(eid,args={},&block) # {{{
675
675
  return if self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
676
676
  __weel_protect_yield(&block) if __weel_is_in_search_mode || !Thread.current[:alternative_executed].last
677
677
  end # }}}
@@ -709,7 +709,7 @@ class WEEL
709
709
  end #}}}
710
710
 
711
711
  # Defines a critical block (=Mutex)
712
- def critical(id,&block)# {{{
712
+ def critical(eid,id,&block)# {{{
713
713
  return if self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
714
714
  @__weel_critical ||= Mutex.new
715
715
  semaphore = nil
@@ -724,7 +724,7 @@ class WEEL
724
724
  end # }}}
725
725
 
726
726
  # Defines a Cycle (loop/iteration)
727
- def loop(condition,args={},&block)# {{{
727
+ def loop(eid,condition,args={},&block)# {{{
728
728
  unless condition[0].is_a?(String) && [:pre_test,:post_test].include?(condition[1]) && args.is_a?(Hash)
729
729
  raise "condition must be called pre_test{} or post_test{}"
730
730
  end
@@ -746,7 +746,7 @@ class WEEL
746
746
  catch :escape do
747
747
  case condition[1]
748
748
  when :pre_test
749
- while __weel_eval_condition(condition[0],args) && self.__weel_state != :stopping && self.__weel_state != :stopped && self.__weel_state != :finishing && !Thread.current[:nolongernecessary]
749
+ while __weel_eval_condition(eid, condition[0],args) && self.__weel_state != :stopping && self.__weel_state != :stopped && self.__weel_state != :finishing && !Thread.current[:nolongernecessary]
750
750
  loop_guard += 1
751
751
  __weel_protect_yield(&block)
752
752
  sleep 1 if @__weel_connectionwrapper::loop_guard(@__weel_connectionwrapper_args,loop_id,loop_guard)
@@ -756,7 +756,7 @@ class WEEL
756
756
  loop_guard += 1
757
757
  __weel_protect_yield(&block)
758
758
  sleep 1 if @__weel_connectionwrapper::loop_guard(@__weel_connectionwrapper_args,loop_id,loop_guard)
759
- end while __weel_eval_condition(condition[0],args) && self.__weel_state != :stopping && self.__weel_state != :stopped && self.__weel_state != :finishing && !Thread.current[:nolongernecessary]
759
+ end while __weel_eval_condition(eid, condition[0],args) && self.__weel_state != :stopping && self.__weel_state != :stopped && self.__weel_state != :finishing && !Thread.current[:nolongernecessary]
760
760
  end
761
761
  end
762
762
  end # }}}
@@ -771,12 +771,12 @@ class WEEL
771
771
  [code || blk, :post_test]
772
772
  end # }}}
773
773
 
774
- def escape #{{{
774
+ def escape(eid) #{{{
775
775
  return if __weel_is_in_search_mode
776
776
  return if self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
777
777
  throw :escape
778
778
  end #}}}
779
- def terminate #{{{
779
+ def terminate(eid) #{{{
780
780
  return if __weel_is_in_search_mode
781
781
  return if self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
782
782
  self.__weel_state = :finishing
@@ -816,10 +816,10 @@ class WEEL
816
816
  end
817
817
  end #}}}
818
818
 
819
- def __weel_eval_condition(condition,args={}) #{{{
819
+ def __weel_eval_condition(eid,condition,args={}) #{{{
820
820
  begin
821
821
  connectionwrapper = @__weel_connectionwrapper.new @__weel_connectionwrapper_args
822
- connectionwrapper.test_condition(@__weel_data,@__weel_endpoints,Thread.current[:local],connectionwrapper.additional,condition,args)
822
+ connectionwrapper.test_condition(eid,@__weel_data,@__weel_endpoints,Thread.current[:local],connectionwrapper.additional,condition,args)
823
823
  rescue NameError => err # don't look into it, or it will explode
824
824
  self.__weel_state = :stopping
825
825
  @__weel_connectionwrapper::inform_syntax_error(@__weel_connectionwrapper_args,Exception.new("protect_yield: `#{err.name}` is not a thing that can be used. Maybe it is meant to be a string and you forgot quotes?"),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.147"
3
+ s.version = "1.99.148"
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.147
4
+ version: 1.99.148
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler