Closed circlespainter closed 10 years ago
It should be allowed. I'll fix it next week.
In addition to removing the (stupid) requirement for the current actor to be a PulsarActor
, this has also exposed a bug in instrumentation of protocols. Clojure may break up a single function into multiple inner classes. This was handled well for plain functions but not for reify
. Now it's fixed.
Added test case:
(fact "Test receive in handle-call"
(co.paralleluniverse.common.util.Debug/dumpAfter 5000 "foo.log")
(let [actor (spawn #(receive
[from m] (! from @self (str m "!!!"))))
gs (spawn
(gen-server (reify Server
(init [_])
(terminate [_ cause])
(handle-call [_ from id [a b]]
(! actor @self (+ a b))
(receive
[actor m] m)))))]
(call! gs 3 4)) => "7!!!")
Uploaded fixed artifact to clojars.
That was a lot of work, thanks! Will try it out tomorrow
Thank you! You've uncovered not one bug, but two!
Oh well, perhaps finding bugs is my talent then :D
I can't remember reading about it not being allowed (but I might have overlooked), Happens against current pulsar 0.4.0-SNAPSHOT in maven repos, quasar from local build (yesterday afternoon's 0.4.0-SNAPSHOT).
Code to reproduce it:
Full exception: