Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

m/sleep does not terminate after exception #81

Open
den1k opened this issue Mar 25, 2023 · 1 comment
Open

m/sleep does not terminate after exception #81

den1k opened this issue Mar 25, 2023 · 1 comment

Comments

@den1k
Copy link

den1k commented Mar 25, 2023

After executing the code below which is incorrect and throws an exception, m/sleep ceases to terminate in future evaluations

(m/? (m/ap
       (let [delay (m/?> ##Inf (m/seed [100]))]
         (m/? (m/sleep delay delay)))))

Exception in thread "missionary scheduler" clojure.lang.ArityException:
Wrong number of args (0) passed to: missionary.impl.Fiber/1/1/1
(m/? (m/sleep 100)) ;; deadlock
@leonoel
Copy link
Owner

leonoel commented Mar 25, 2023

One alternative could be to detect the user error earlier, in this case ? should be able to check that ap is not a task and raise an exception instead of trying to run it.
See also #63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants