You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Entering the following in the REPL should return "got: 123" immediately:
; Example 1:; With Pulsar 0.7.5
(defch1 (channel))
(deffi1 (->> (spawn-fiber (fn one [ch] (rcv ch 10000:ms)) ch1)
(spawn-fiber (fn two [v] (str"got: " @v)))))
(snd ch1 123)
@fi1
;;=> "got: "
But when using Pulsar 0.7.5 @fi1 blocks until the 'rcv' times out. Though (snd ch1 123) does accept the value immediately/does not block, the rcv ch seems to never receive the value.
When I macroexpand one level and run:
; Example 2:
(defch1 (channel))
(deffi1 (spawn-fiber (fn two [v] (str"got: " @v))
(spawn-fiber (fn one [ch] (rcv ch 10000:ms)) ch1)))
(snd ch1 123)
@fi1
;;=> "got: 123"
I get the expected outcome: "got: 123". However if I enter the same four expressions again @fi1 blocks and I get "got: ".
If I then rename the channel the process works again:
; Example 1 (first run):; With Pulsar 0.7.6
(defch1 (channel))
(deffi1 (->> (spawn-fiber (fn one [ch] (rcv ch 10000:ms)) ch1)
(spawn-fiber (fn two [v] (str"got: " @v)))))
(snd ch1 123)
@fi1
;;=> "got: 123"
Also the second example succeeds as it did with Pulsar 0.7.5:
; Example 2 (first run):; With Pulsar 0.7.6
(defch1 (channel))
(deffi1 (spawn-fiber (fn two [v] (str"got: " @v))
(spawn-fiber (fn one [ch] (rcv ch 10000:ms)) ch1)))
(snd ch1 123)
@fi1
;;=> "got: 123"
But entering example 1 or example 2 a second time will fail as it did with 0.7.5.
Curiously, renaming the channel does not help with 0.7.6 as it did with 0.7.5:
; Example 2 (nth run):; With Pulsar 0.7.6
(defch2 (channel))
(deffi1 (spawn-fiber (fn two [v] (str"got: " @v))
(spawn-fiber (fn one [ch] (rcv ch 10000:ms)) ch2)))
(snd ch2 123)
@fi1
;;=> "got: "
(Note: I'm currently preferring 0.7.5 as 0.7.6 seems to increase REPL startup time significantly in mid-sized projects. I could document this in a separate issue if it helps)
The text was updated successfully, but these errors were encountered:
Entering the following in the REPL should return
"got: 123"
immediately:But when using Pulsar 0.7.5
@fi1
blocks until the 'rcv' times out. Though(snd ch1 123)
does accept the value immediately/does not block, thercv ch
seems to never receive the value.When I macroexpand one level and run:
I get the expected outcome:
"got: 123"
. However if I enter the same four expressions again@fi1
blocks and I get"got: "
.If I then rename the channel the process works again:
But I can only run this once per channel name. (This seems related to #60)
Running the following code always succeeds (in Pulsar 0.7.5 and 0.7.6) - I can enter it repeatedly in the REPL and it shows the same expected outcome:
With Pulsar 0.7.6 this succeeds in the first run:
Also the second example succeeds as it did with Pulsar 0.7.5:
But entering example 1 or example 2 a second time will fail as it did with
0.7.5
.Curiously, renaming the channel does not help with 0.7.6 as it did with 0.7.5:
(Note: I'm currently preferring 0.7.5 as 0.7.6 seems to increase REPL startup time significantly in mid-sized projects. I could document this in a separate issue if it helps)
The text was updated successfully, but these errors were encountered: