Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

do not block anymore on empty concurrence

  • Loading branch information...
commit 6fb058db6ff853fa34c156a9d09c88f3b3f34f9a 1 parent 76ffd08
@jmettraux authored
View
14 TODO.txt
@@ -316,6 +316,8 @@
[x] exp : variable (not really necessary)
[o] expression :concurrent => true idea (reply immediately, cancellable)
`- covered by :flank => true
+[o] concurrence: allow empty
+[o] citerator: allow empty
[ ] exp : at expression ? comparable to cron
[x] exp : exp (restricted form of eval ?) (is it apply ?)
@@ -384,9 +386,6 @@
[ ] LocalParticipant def consume; handle; reply; end
-[ ] find better solution than "get all schedules"
- ... or discard get_schedules completely
-
[ ] worker : minuteman, make it cron triggerable
trap SIGUSR1 or USR2
maybe it's expensive to fire a [worker] process each minute
@@ -485,9 +484,6 @@
[ ] subaltern for conditions?
[ ] enhance radial/Parslet error messages (cf Raphael)
-[ ] concurrence: allow empty
-[o] citerator: allow empty
-
[ ] concurrence: reply_to_parent instead of cease when no more children ?
https://github.com/jmettraux/ruote/blob/1f9add961f90049ea951b8940622fbe8d136c45f/lib/ruote/exp/fe_concurrence.rb#L304-310
@@ -498,6 +494,9 @@
[ ] on_timeout like on_error expression (or make timeout an error)
[ ] #get_msgs to cover #get_schedules (make #get_schedules empty)
+ | | |
+[ ] find better solution than "get all schedules"
+ ... or discard get_schedules completely
[ ] eft_6_concurrence : 2 Fs when running standalone...
@@ -508,3 +507,6 @@
(let the storage include triggered schedules as msgs)
[ ] deprecate "trackers as variables"
+== 4.0
+[ ] deprecate listen (await?) or make it an alias of await?
+
View
2  lib/ruote/exp/fe_concurrence.rb
@@ -275,6 +275,8 @@ class ConcurrenceExpression < FlowExpression
def apply
+ return do_reply_to_parent(h.applied_workitem) if tree_children.empty?
+
#
# count and wait_for
View
54 test/functional/eft_6_concurrence.rb
@@ -24,11 +24,36 @@ def test_basic
tracer << "alpha\n"
end
- #noisy
-
assert_trace %w[ alpha alpha ], pdef
end
+ def test_empty
+
+ pdef = Ruote.process_definition do
+ concurrence do
+ end
+ echo 'done.'
+ end
+
+ assert_trace %w[ done. ], pdef
+ end
+
+ def test_accidental_empty
+
+ @dashboard.register_participant :nada do
+ tracer << "nada\n"
+ end
+
+ pdef = Ruote.process_definition do
+ concurrence do
+ nada :if => false
+ end
+ echo 'done.'
+ end
+
+ assert_trace %w[ done. ], pdef
+ end
+
def test_over_if
pdef = Ruote.process_definition do
@@ -54,8 +79,6 @@ def test_over_if
nil
end
- #noisy
-
assert_trace(%w[ alpha ] * 3, pdef)
#assert_equal(
@@ -79,8 +102,6 @@ def test_over_if__remaining_cancel
end
end
- #@dashboard.noisy = true
-
wfid = @dashboard.launch(pdef)
@dashboard.wait_for('dispatched')
@@ -157,8 +178,6 @@ def test_over_unless
fields = workitem.fields
end
- #noisy
-
assert_trace(%w[ a a done. ], pdef)
end
@@ -172,8 +191,6 @@ def test_remaining_forget_when_no_remains
echo 'done.'
end
- #noisy
-
assert_trace %w[ a b done. ], %w[ b a done. ], pdef
end
@@ -286,8 +303,6 @@ def run_test_count(remaining, noise)
def test_count
- #noisy
-
wfid = run_test_count('cancel', false)
#puts
@@ -302,8 +317,6 @@ def test_count
def test_count_remaining_forget
- #noisy
-
wfid = run_test_count('forget', false)
#assert_equal 1, logger.log.select { |e| e['action'] == 'forget' }.size
@@ -353,8 +366,6 @@ def test_cancel
alpha = @dashboard.register_participant :alpha, Ruote::StorageParticipant
- #noisy
-
wfid = @dashboard.launch(pdef)
wait_for(:alpha)
@@ -389,8 +400,6 @@ def test_wait_for_int
echo 'over.'
end
- #@dashboard.noisy = true
-
wfid = @dashboard.launch(pdef)
@dashboard.wait_for(wfid)
@@ -410,8 +419,6 @@ def test_wait_for_zero
echo 'over.'
end
- #@dashboard.noisy = true
-
wfid = @dashboard.launch(pdef)
@dashboard.wait_for(wfid)
@@ -435,8 +442,6 @@ def test_wait_for_tags
end
end
- #@dashboard.noisy = true
-
wfid = @dashboard.launch(pdef)
r = @dashboard.wait_for(wfid)
@@ -461,8 +466,6 @@ def test_wait_for_tags_array
end
end
- #@dashboard.noisy = true
-
wfid = @dashboard.launch(pdef)
r = @dashboard.wait_for(wfid)
@@ -480,8 +483,6 @@ def test_wait_for_unknown_tag
echo 'c'
end
- #@dashboard.noisy = true
-
wfid = @dashboard.launch(pdef)
r = @dashboard.wait_for(wfid)
@@ -501,7 +502,6 @@ def test_remaining_wait
end
end
- #@dashboard.noisy = true
wfid = @dashboard.launch(pdef); r = @dashboard.wait_for(wfid)
assert_equal(
Please sign in to comment.
Something went wrong with that request. Please try again.