weel 1.99.121 → 1.99.122
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.
- checksums.yaml +4 -4
- data/lib/weel.rb +103 -173
- data/weel.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9a667f015c959147b33b0acab3119502d4f62b1b5785836f236819324e9fa2bd
|
|
4
|
+
data.tar.gz: a68fc1c9c3a04525b18faca8cd0b9de14c2863746a8b5a010933108a13e9e675
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '09dd1a1407dd46e8361b6d80266c81298503eb67369462db4120405b8a3497fd658a0bd4cf9f5002690b595494ef23597a84090cd7dcfb03b80e106af7444e90'
|
|
7
|
+
data.tar.gz: 6fd1dac78629fe28677b0d5fd35ae0d1d802787a1113c6cc765fd8b9d5814c61c6bdf53bf69a188dd9331ed7b2efeb625866c1f49a65ada4579b23bc6fae0731
|
data/lib/weel.rb
CHANGED
|
@@ -38,6 +38,7 @@ class WEEL
|
|
|
38
38
|
class Proceed < Exception; end
|
|
39
39
|
class NoLongerNecessary < Exception; end
|
|
40
40
|
class Again < Exception; end
|
|
41
|
+
class UpdateAgain < Exception; end
|
|
41
42
|
class Error < Exception; end
|
|
42
43
|
class Salvage < Exception; end
|
|
43
44
|
end # }}}
|
|
@@ -269,9 +270,8 @@ class WEEL
|
|
|
269
270
|
end #}}}
|
|
270
271
|
|
|
271
272
|
class ReadHash # {{{
|
|
272
|
-
def initialize(values
|
|
273
|
+
def initialize(values)
|
|
273
274
|
@__weel_values = values
|
|
274
|
-
@__weel_sim = sim
|
|
275
275
|
end
|
|
276
276
|
|
|
277
277
|
def to_json(*args)
|
|
@@ -279,29 +279,25 @@ class WEEL
|
|
|
279
279
|
end
|
|
280
280
|
|
|
281
281
|
def method_missing(name,*args)
|
|
282
|
-
if @
|
|
283
|
-
|
|
282
|
+
if args.empty? && @__weel_values.key?(name)
|
|
283
|
+
@__weel_values[name]
|
|
284
|
+
elsif args.empty? && @__weel_values.key?(name.to_s)
|
|
285
|
+
@__weel_values[name.to_s]
|
|
286
|
+
elsif name.to_s[-1..-1] == "=" && args.length == 1
|
|
287
|
+
temp = name.to_s[0..-2]
|
|
288
|
+
@__weel_values[temp.to_sym] = args[0]
|
|
289
|
+
elsif name.to_s == "[]=" && args.length == 2
|
|
290
|
+
@__weel_values[args[0]] = args[1]
|
|
291
|
+
elsif name.to_s == "[]" && args.length == 1
|
|
292
|
+
@__weel_values[args[0]]
|
|
284
293
|
else
|
|
285
|
-
|
|
286
|
-
@__weel_values[name]
|
|
287
|
-
elsif args.empty? && @__weel_values.key?(name.to_s)
|
|
288
|
-
@__weel_values[name.to_s]
|
|
289
|
-
elsif name.to_s[-1..-1] == "=" && args.length == 1
|
|
290
|
-
temp = name.to_s[0..-2]
|
|
291
|
-
@__weel_values[temp.to_sym] = args[0]
|
|
292
|
-
elsif name.to_s == "[]=" && args.length == 2
|
|
293
|
-
@__weel_values[args[0]] = args[1]
|
|
294
|
-
elsif name.to_s == "[]" && args.length == 1
|
|
295
|
-
@__weel_values[args[0]]
|
|
296
|
-
else
|
|
297
|
-
nil
|
|
298
|
-
end
|
|
294
|
+
nil
|
|
299
295
|
end
|
|
300
296
|
end
|
|
301
297
|
end # }}}
|
|
302
298
|
|
|
303
299
|
class ReadOnlyHash # {{{
|
|
304
|
-
def initialize(values
|
|
300
|
+
def initialize(values)
|
|
305
301
|
@__weel_values = values.transform_values do |v|
|
|
306
302
|
if Object.const_defined?(:XML) && XML.const_defined?(:Smart) && v.is_a?(XML::Smart::Dom)
|
|
307
303
|
v.root.to_doc
|
|
@@ -313,7 +309,6 @@ class WEEL
|
|
|
313
309
|
end
|
|
314
310
|
end
|
|
315
311
|
end
|
|
316
|
-
@__weel_sim = sim
|
|
317
312
|
end
|
|
318
313
|
|
|
319
314
|
def to_json(*args)
|
|
@@ -321,23 +316,19 @@ class WEEL
|
|
|
321
316
|
end
|
|
322
317
|
|
|
323
318
|
def method_missing(name,*args)
|
|
324
|
-
if @
|
|
325
|
-
|
|
319
|
+
if args.empty? && @__weel_values.key?(name)
|
|
320
|
+
@__weel_values[name]
|
|
321
|
+
elsif args.empty? && @__weel_values.key?(name.to_s)
|
|
322
|
+
@__weel_values[name.to_s]
|
|
323
|
+
elsif name.to_s[-1..-1] == "=" && args.length == 1
|
|
324
|
+
temp = name.to_s[0..-2]
|
|
325
|
+
@__weel_values[temp.to_sym] = args[0]
|
|
326
|
+
elsif name.to_s == "[]=" && args.length == 2
|
|
327
|
+
@__weel_values[args[0]] = args[1]
|
|
328
|
+
elsif name.to_s == "[]" && args.length == 1
|
|
329
|
+
@__weel_values[args[0]]
|
|
326
330
|
else
|
|
327
|
-
|
|
328
|
-
@__weel_values[name]
|
|
329
|
-
elsif args.empty? && @__weel_values.key?(name.to_s)
|
|
330
|
-
@__weel_values[name.to_s]
|
|
331
|
-
elsif name.to_s[-1..-1] == "=" && args.length == 1
|
|
332
|
-
temp = name.to_s[0..-2]
|
|
333
|
-
@__weel_values[temp.to_sym] = args[0]
|
|
334
|
-
elsif name.to_s == "[]=" && args.length == 2
|
|
335
|
-
@__weel_values[args[0]] = args[1]
|
|
336
|
-
elsif name.to_s == "[]" && args.length == 1
|
|
337
|
-
@__weel_values[args[0]]
|
|
338
|
-
else
|
|
339
|
-
nil
|
|
340
|
-
end
|
|
331
|
+
nil
|
|
341
332
|
end
|
|
342
333
|
end
|
|
343
334
|
end # }}}
|
|
@@ -374,12 +365,6 @@ class WEEL
|
|
|
374
365
|
def vote_sync_before(parameters=nil); true; end
|
|
375
366
|
def vote_sync_after; true; end
|
|
376
367
|
|
|
377
|
-
# type => activity, loop, parallel, choice
|
|
378
|
-
# nesting => none, start, end
|
|
379
|
-
# eid => id's also for control structures
|
|
380
|
-
# parameters => stuff given to the control structure
|
|
381
|
-
def simulate(type,nesting,sequence,parent,parameters={}); end
|
|
382
|
-
|
|
383
368
|
def callback(result=nil,options={}); end
|
|
384
369
|
def mem_guard; end
|
|
385
370
|
|
|
@@ -396,6 +381,7 @@ class WEEL
|
|
|
396
381
|
end
|
|
397
382
|
|
|
398
383
|
def join_branches(branches); end
|
|
384
|
+
def split_branches(branches); end
|
|
399
385
|
end # }}}
|
|
400
386
|
|
|
401
387
|
class Position # {{{
|
|
@@ -499,7 +485,7 @@ class WEEL
|
|
|
499
485
|
@__weel_connectionwrapper_args = []
|
|
500
486
|
@__weel_state = :ready
|
|
501
487
|
@__weel_status = Status.new(0,"undefined")
|
|
502
|
-
@__weel_sim =
|
|
488
|
+
@__weel_sim = false
|
|
503
489
|
@__weel_lock = Mutex.new
|
|
504
490
|
end #}}}
|
|
505
491
|
attr_accessor :__weel_search_positions, :__weel_positions, :__weel_main, :__weel_data, :__weel_endpoints, :__weel_connectionwrapper, :__weel_connectionwrapper_args
|
|
@@ -538,8 +524,6 @@ class WEEL
|
|
|
538
524
|
Thread.current[:branch_event] = Continue.new
|
|
539
525
|
Thread.current[:mutex] = Mutex.new
|
|
540
526
|
|
|
541
|
-
hw, pos = __weel_sim_start(:parallel) if __weel_sim
|
|
542
|
-
|
|
543
527
|
__weel_protect_yield(&block)
|
|
544
528
|
|
|
545
529
|
Thread.current[:branch_wait_count] = (type.is_a?(Hash) && type[:wait] != nil && (type[:wait].is_a?(Integer) && type[:wait] > 0) ? type[:wait] : Thread.current[:branches].size)
|
|
@@ -549,6 +533,9 @@ class WEEL
|
|
|
549
533
|
Thread.current[:branch_event].wait
|
|
550
534
|
end
|
|
551
535
|
|
|
536
|
+
cw = @__weel_connectionwrapper.new @__weel_connectionwrapper_args
|
|
537
|
+
cw.split_branches(Thread.current[:branch_traces])
|
|
538
|
+
|
|
552
539
|
Thread.current[:branches].each do |thread|
|
|
553
540
|
# decide after executing block in parallel cause for coopis
|
|
554
541
|
# it goes out of search mode while dynamically counting branches
|
|
@@ -560,10 +547,6 @@ class WEEL
|
|
|
560
547
|
|
|
561
548
|
Thread.current[:branch_event].wait unless self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:branches].length == 0
|
|
562
549
|
|
|
563
|
-
__weel_sim_stop(:parallel,hw,pos) if __weel_sim
|
|
564
|
-
|
|
565
|
-
cw = @__weel_connectionwrapper.new @__weel_connectionwrapper_args
|
|
566
|
-
|
|
567
550
|
cw.join_branches(Thread.current[:branch_traces])
|
|
568
551
|
|
|
569
552
|
unless self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped
|
|
@@ -584,11 +567,6 @@ class WEEL
|
|
|
584
567
|
return if self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
|
|
585
568
|
branch_parent = Thread.current
|
|
586
569
|
|
|
587
|
-
if __weel_sim
|
|
588
|
-
# catch the potential execution in loops inside a parallel
|
|
589
|
-
current_branch_sim_pos = branch_parent[:branch_sim_pos]
|
|
590
|
-
end
|
|
591
|
-
|
|
592
570
|
branch_parent[:branches] << Thread.new(*vars) do |*local|
|
|
593
571
|
Thread.current.abort_on_exception = true
|
|
594
572
|
Thread.current[:branch_search] = @__weel_search_positions.any?
|
|
@@ -601,10 +579,6 @@ class WEEL
|
|
|
601
579
|
branch_parent[:branch_traces_ids] += 1
|
|
602
580
|
end
|
|
603
581
|
|
|
604
|
-
if __weel_sim
|
|
605
|
-
Thread.current[:branch_sim_pos] = @__weel_sim += 1
|
|
606
|
-
end
|
|
607
|
-
|
|
608
582
|
# parallel_branch could be possibly around an alternative. Thus thread has to inherit the alternative_executed
|
|
609
583
|
# after branching, update it in the parent (TODO)
|
|
610
584
|
if branch_parent[:alternative_executed] && branch_parent[:alternative_executed].length > 0
|
|
@@ -614,17 +588,10 @@ class WEEL
|
|
|
614
588
|
branch_parent[:branch_event].continue
|
|
615
589
|
Thread.current[:start_event].wait unless self.__weel_state == :stopping || self.__weel_state == :stopped || self.__weel_state == :finishing
|
|
616
590
|
|
|
617
|
-
if __weel_sim
|
|
618
|
-
connectionwrapper = @__weel_connectionwrapper.new @__weel_connectionwrapper_args
|
|
619
|
-
connectionwrapper.simulate(:parallel_branch,:start,Thread.current[:branch_sim_pos],current_branch_sim_pos)
|
|
620
|
-
end
|
|
621
|
-
|
|
622
591
|
unless self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
|
|
623
592
|
__weel_protect_yield(*local, &block)
|
|
624
593
|
end
|
|
625
594
|
|
|
626
|
-
__weel_sim_stop(:parallel_branch,connectionwrapper,current_branch_sim_pos) if __weel_sim
|
|
627
|
-
|
|
628
595
|
branch_parent[:mutex].synchronize do
|
|
629
596
|
branch_parent[:branch_finished_count] += 1
|
|
630
597
|
|
|
@@ -666,9 +633,11 @@ class WEEL
|
|
|
666
633
|
Thread.current[:alternative_mode] ||= []
|
|
667
634
|
Thread.current[:alternative_executed] << false
|
|
668
635
|
Thread.current[:alternative_mode] << mode
|
|
669
|
-
|
|
636
|
+
|
|
637
|
+
cw = @__weel_connectionwrapper.new @__weel_connectionwrapper_args
|
|
638
|
+
cw.split_branches(Thread.current[:branch_traces])
|
|
639
|
+
|
|
670
640
|
__weel_protect_yield(&block)
|
|
671
|
-
__weel_sim_stop(:choose,hw,pos,:mode => Thread.current[:alternative_mode].last) if __weel_sim
|
|
672
641
|
Thread.current[:alternative_executed].pop
|
|
673
642
|
Thread.current[:alternative_mode].pop
|
|
674
643
|
nil
|
|
@@ -679,25 +648,21 @@ class WEEL
|
|
|
679
648
|
# searchmode is active (to find the starting position)
|
|
680
649
|
def alternative(condition,args={},&block)# {{{
|
|
681
650
|
return if self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
|
|
682
|
-
hw, pos = __weel_sim_start(:alternative,args.merge(:mode => Thread.current[:alternative_mode].last, :condition => (condition.is_a?(String) ? condition : nil))) if __weel_sim
|
|
683
651
|
Thread.current[:mutex] ||= Mutex.new
|
|
684
652
|
Thread.current[:mutex].synchronize do
|
|
685
653
|
return if Thread.current[:alternative_mode][-1] == :exclusive && Thread.current[:alternative_executed][-1] == true
|
|
686
|
-
if condition.is_a?(String)
|
|
654
|
+
if condition.is_a?(String)
|
|
687
655
|
condition = __weel_eval_condition(condition, args)
|
|
688
656
|
end
|
|
689
657
|
Thread.current[:alternative_executed][-1] = true if condition
|
|
690
658
|
end
|
|
691
659
|
searchmode = __weel_is_in_search_mode
|
|
692
|
-
__weel_protect_yield(&block) if searchmode ||
|
|
660
|
+
__weel_protect_yield(&block) if searchmode || condition
|
|
693
661
|
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
|
|
694
|
-
__weel_sim_stop(:alternative,hw,pos,args.merge(:mode => Thread.current[:alternative_mode].last, :condition => (condition.is_a?(String) ? condition : nil))) if __weel_sim
|
|
695
662
|
end # }}}
|
|
696
663
|
def otherwise(args={},&block) # {{{
|
|
697
664
|
return if self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
|
|
698
|
-
|
|
699
|
-
__weel_protect_yield(&block) if __weel_is_in_search_mode || __weel_sim || !Thread.current[:alternative_executed].last
|
|
700
|
-
__weel_sim_stop(:otherwise,hw,pos,args.merge(:mode => Thread.current[:alternative_mode].last)) if __weel_sim
|
|
665
|
+
__weel_protect_yield(&block) if __weel_is_in_search_mode || !Thread.current[:alternative_executed].last
|
|
701
666
|
end # }}}
|
|
702
667
|
|
|
703
668
|
# Defines a critical block (=Mutex)
|
|
@@ -733,15 +698,6 @@ class WEEL
|
|
|
733
698
|
condition[1] = :pre_test
|
|
734
699
|
end
|
|
735
700
|
end
|
|
736
|
-
if __weel_sim
|
|
737
|
-
cond = condition[0]
|
|
738
|
-
hw, pos = __weel_sim_start(:loop,args.merge(:testing=>condition[1],:condition=>cond))
|
|
739
|
-
catch :escape do
|
|
740
|
-
__weel_protect_yield(&block)
|
|
741
|
-
end
|
|
742
|
-
__weel_sim_stop(:loop,hw,pos,args.merge(:testing=>condition[1],:condition=>cond))
|
|
743
|
-
return
|
|
744
|
-
end
|
|
745
701
|
loop_guard = 0
|
|
746
702
|
loop_id = SecureRandom.uuid
|
|
747
703
|
catch :escape do
|
|
@@ -802,7 +758,7 @@ class WEEL
|
|
|
802
758
|
@__weel_status
|
|
803
759
|
end # }}}
|
|
804
760
|
def data # {{{
|
|
805
|
-
ReadOnlyHash.new(@__weel_data
|
|
761
|
+
ReadOnlyHash.new(@__weel_data)
|
|
806
762
|
end # }}}
|
|
807
763
|
def endpoints # {{{
|
|
808
764
|
ReadHash.new(@__weel_endpoints)
|
|
@@ -902,11 +858,6 @@ class WEEL
|
|
|
902
858
|
Thread.current[:continue] = Continue.new
|
|
903
859
|
connectionwrapper = @__weel_connectionwrapper.new @__weel_connectionwrapper_args, position, Thread.current[:continue]
|
|
904
860
|
|
|
905
|
-
if __weel_sim
|
|
906
|
-
connectionwrapper.simulate(:activity,:none,@__weel_sim += 1,Thread.current[:branch_sim_pos],:position => position,:parameters => parameters,:endpoint => endpoint,:type => type,:finalize => finalize.is_a?(String) ? finalize : nil)
|
|
907
|
-
return
|
|
908
|
-
end
|
|
909
|
-
|
|
910
861
|
# gather traces in threads to point to join
|
|
911
862
|
if Thread.current[:branch_parent] && Thread.current[:branch_traces_id]
|
|
912
863
|
Thread.current[:branch_parent][:branch_traces][Thread.current[:branch_traces_id]] ||= []
|
|
@@ -936,81 +887,77 @@ class WEEL
|
|
|
936
887
|
@__weel_connectionwrapper::inform_position_change @__weel_connectionwrapper_args, :after => [wp]
|
|
937
888
|
end
|
|
938
889
|
when :call
|
|
939
|
-
|
|
940
|
-
|
|
890
|
+
again = catch Signal::Again do
|
|
891
|
+
connectionwrapper.mem_guard
|
|
892
|
+
struct = if prepare
|
|
893
|
+
connectionwrapper.manipulate(true,@__weel_lock,@__weel_data,@__weel_endpoints,@__weel_status,Thread.current[:local],connectionwrapper.additional,prepare,'Activity ' + position.to_s)
|
|
894
|
+
else
|
|
895
|
+
# just the read structure, no code exec necessary
|
|
896
|
+
ReadStructure.new(@__weel_data,@__weel_endpoints,Thread.current[:local],connectionwrapper.additional)
|
|
897
|
+
end
|
|
898
|
+
params = connectionwrapper.prepare(struct,endpoint,parameters)
|
|
899
|
+
raise Signal::Stop unless connectionwrapper.vote_sync_before(params)
|
|
900
|
+
raise Signal::Skip if self.__weel_state == :stopping || self.__weel_state == :finishing
|
|
901
|
+
|
|
902
|
+
connectionwrapper.activity_handle wp.passthrough, params
|
|
903
|
+
wp.passthrough = connectionwrapper.activity_passthrough_value
|
|
904
|
+
unless wp.passthrough.nil?
|
|
905
|
+
@__weel_connectionwrapper::inform_position_change @__weel_connectionwrapper_args, :wait => [wp]
|
|
906
|
+
end
|
|
907
|
+
begin
|
|
908
|
+
# cleanup after callback updates
|
|
941
909
|
connectionwrapper.mem_guard
|
|
942
|
-
struct = if prepare
|
|
943
|
-
connectionwrapper.manipulate(true,@__weel_lock,@__weel_data,@__weel_endpoints,@__weel_status,Thread.current[:local],connectionwrapper.additional,prepare,'Activity ' + position.to_s)
|
|
944
|
-
else
|
|
945
|
-
# just the read structure, no code exec necessary
|
|
946
|
-
ReadStructure.new(@__weel_data,@__weel_endpoints,Thread.current[:local],connectionwrapper.additional)
|
|
947
|
-
end
|
|
948
|
-
params = connectionwrapper.prepare(struct,endpoint,parameters)
|
|
949
|
-
raise Signal::Stop unless connectionwrapper.vote_sync_before(params)
|
|
950
|
-
raise Signal::Skip if self.__weel_state == :stopping || self.__weel_state == :finishing
|
|
951
|
-
|
|
952
|
-
connectionwrapper.activity_handle wp.passthrough, params
|
|
953
|
-
wp.passthrough = connectionwrapper.activity_passthrough_value
|
|
954
|
-
unless wp.passthrough.nil?
|
|
955
|
-
@__weel_connectionwrapper::inform_position_change @__weel_connectionwrapper_args, :wait => [wp]
|
|
956
|
-
end
|
|
957
|
-
begin
|
|
958
|
-
# cleanup after callback updates
|
|
959
|
-
connectionwrapper.mem_guard
|
|
960
910
|
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
911
|
+
# with loop if catching Signal::Again
|
|
912
|
+
# handshake call and wait until it finished
|
|
913
|
+
waitingresult = nil
|
|
914
|
+
waitingresult = Thread.current[:continue].wait unless Thread.current[:nolongernecessary] || self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped
|
|
965
915
|
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
raise Signal::Proceed if wp.passthrough # if stop, but no passthrough, let manipulate happen and then stop
|
|
976
|
-
end
|
|
916
|
+
if Thread.current[:nolongernecessary]
|
|
917
|
+
connectionwrapper.activity_no_longer_necessary
|
|
918
|
+
raise Signal::NoLongerNecessary
|
|
919
|
+
end
|
|
920
|
+
if self.__weel_state == :stopping || self.__weel_state == :finishing
|
|
921
|
+
connectionwrapper.activity_stop
|
|
922
|
+
wp.passthrough = connectionwrapper.activity_passthrough_value
|
|
923
|
+
raise Signal::Proceed if wp.passthrough # if stop, but no passthrough, let manipulate happen and then stop
|
|
924
|
+
end
|
|
977
925
|
|
|
978
|
-
|
|
926
|
+
next if waitingresult == WEEL::Signal::UpdateAgain && connectionwrapper.activity_result_value&.length == 0
|
|
979
927
|
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
end
|
|
996
|
-
connectionwrapper.inform_manipulate_change(
|
|
997
|
-
((struct && struct.changed_status) ? @__weel_status : nil),
|
|
998
|
-
((struct && struct.changed_data.any?) ? struct.changed_data.uniq : nil),
|
|
999
|
-
((struct && struct.changed_endpoints.any?) ? struct.changed_endpoints.uniq : nil),
|
|
1000
|
-
@__weel_data,
|
|
1001
|
-
@__weel_endpoints
|
|
1002
|
-
)
|
|
1003
|
-
throw(Signal::Again, Signal::Again) if ma.nil?
|
|
928
|
+
code = if waitingresult == WEEL::Signal::UpdateAgain
|
|
929
|
+
update
|
|
930
|
+
elsif waitingresult == WEEL::Signal::Salvage
|
|
931
|
+
salvage || raise('HTTP Error. The service return status was not between 200 and 300.')
|
|
932
|
+
else
|
|
933
|
+
finalize
|
|
934
|
+
end
|
|
935
|
+
if code.is_a?(String)
|
|
936
|
+
connectionwrapper.inform_activity_manipulate
|
|
937
|
+
struct = nil
|
|
938
|
+
|
|
939
|
+
# when you throw without parameters, ma contains nil, so we return Signal::Proceed to give ma a meaningful value in other cases
|
|
940
|
+
ma = catch Signal::Again do
|
|
941
|
+
struct = connectionwrapper.manipulate(false,@__weel_lock,@__weel_data,@__weel_endpoints,@__weel_status,Thread.current[:local],connectionwrapper.additional,code,'Activity ' + position.to_s,connectionwrapper.activity_result_value,connectionwrapper.activity_result_options)
|
|
942
|
+
Signal::Proceed
|
|
1004
943
|
end
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
944
|
+
connectionwrapper.inform_manipulate_change(
|
|
945
|
+
((struct && struct.changed_status) ? @__weel_status : nil),
|
|
946
|
+
((struct && struct.changed_data.any?) ? struct.changed_data.uniq : nil),
|
|
947
|
+
((struct && struct.changed_endpoints.any?) ? struct.changed_endpoints.uniq : nil),
|
|
948
|
+
@__weel_data,
|
|
949
|
+
@__weel_endpoints
|
|
950
|
+
)
|
|
951
|
+
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
|
|
1011
952
|
end
|
|
953
|
+
end while waitingresult == Signal::UpdateAgain # this signal again loops because async update, proposal: rename to UpdateAgain
|
|
954
|
+
if connectionwrapper.activity_passthrough_value.nil?
|
|
955
|
+
connectionwrapper.inform_activity_done
|
|
956
|
+
wp.passthrough = nil
|
|
957
|
+
wp.detail = :after
|
|
958
|
+
@__weel_connectionwrapper::inform_position_change @__weel_connectionwrapper_args, :after => [wp]
|
|
1012
959
|
end
|
|
1013
|
-
end
|
|
960
|
+
end # there is a catch
|
|
1014
961
|
end
|
|
1015
962
|
raise Signal::Proceed
|
|
1016
963
|
rescue Signal::SkipManipulate, Signal::Proceed
|
|
@@ -1122,23 +1069,6 @@ class WEEL
|
|
|
1122
1069
|
end
|
|
1123
1070
|
end # }}}
|
|
1124
1071
|
|
|
1125
|
-
def __weel_sim #{{{
|
|
1126
|
-
@__weel_state == :simulating
|
|
1127
|
-
end #}}}
|
|
1128
|
-
|
|
1129
|
-
def __weel_sim_start(what,options={}) #{{{
|
|
1130
|
-
current_branch_sim_pos = Thread.current[:branch_sim_pos]
|
|
1131
|
-
Thread.current[:branch_sim_pos] = @__weel_sim += 1
|
|
1132
|
-
connectionwrapper = @__weel_connectionwrapper.new @__weel_connectionwrapper_args
|
|
1133
|
-
connectionwrapper.simulate(what,:start,Thread.current[:branch_sim_pos],current_branch_sim_pos,options)
|
|
1134
|
-
[connectionwrapper, current_branch_sim_pos]
|
|
1135
|
-
end #}}}
|
|
1136
|
-
|
|
1137
|
-
def __weel_sim_stop(what,connectionwrapper,current_branch_sim_pos,options={}) #{{{
|
|
1138
|
-
connectionwrapper.simulate(what,:end,Thread.current[:branch_sim_pos],current_branch_sim_pos,options)
|
|
1139
|
-
Thread.current[:branch_sim_pos] = current_branch_sim_pos
|
|
1140
|
-
end #}}}
|
|
1141
|
-
|
|
1142
1072
|
public
|
|
1143
1073
|
def __weel_finalize #{{{
|
|
1144
1074
|
__weel_recursive_join(@__weel_main)
|
data/weel.gemspec
CHANGED
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.
|
|
4
|
+
version: 1.99.122
|
|
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-
|
|
12
|
+
date: 2024-09-17 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: test-unit
|