From 5c384cab27113e74c998811d85f65700c0827060 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Mon, 16 May 2022 07:05:17 +0000 Subject: Implement timeouts for receive --- tests/demo.apl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/demo.apl b/tests/demo.apl index 7a6ddca..99ef783 100644 --- a/tests/demo.apl +++ b/tests/demo.apl @@ -8,6 +8,7 @@ iotaServer←{ msg←1⍨⍇0 msg≡'stop': ⎕←'Bye bye from indexer' (from num)←msg + num<0: ∇⍵⊣ ('some slow result'⊣⎕DL 2)⍈from _←(⍳num)⍈from ∇⍵ } @@ -23,9 +24,19 @@ stop←{ 'stop'⍈id } +flush←{ + ⍺←0 + 12::⍺ + msg←1⍨⍇0 + (⍺+1)∇⍵ +} + iota←{ - ⍝ Sending messages to a nonexisting thread throws a domain error (11) + ⍺←⍬ ⍝ No timeout by default 11::'Sorry, the iota server is not running' + 12::'Sorry, the iota server was too slow to respond' + ⍝ Sending messages to a nonexisting thread throws a domain error (11) + ⍝ And if a timeout happens, an error 12 will happen. _←(⎕self ⍵)⍈id - 1⍨⍇0 + 1⍨⍇⍺ } -- cgit v1.2.3