-
Notifications
You must be signed in to change notification settings - Fork 65
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
Exception when trying to kill fiber from its own fork code #217
Comments
While I agree it shouldn't throw like that, what do you expect the result to be? |
I would expect that the killing behaves exactly how it would if the fiber was killed from outside. Otherwise, in case the library does not want to support this, I'd expect that |
Your example demonstrates the exception, but did this arise naturally in your code? Was a self-kill an intentional design consideration, or was this manufactured to see what would happen? Generally one wants to create a DAG of fibers, as a cycle can't ever successfully resolve. That is, |
It came up in a real use case, but rather as a convenience than as a necessity: Inside a function two fibers where spawned and there was a cleanup function to kill the fibers and do some other things. This cleanup function was called at several places, also in error handlers at the top level of each fiber. The solution was simply to introduce more granular cleanup functionality. |
Describe the bug
The excpetion "TypeError: step is not a function" is thrown when a fiber is killed from its own fork code:
To Reproduce
Open complete minimal reproducible example on Try PureScript
Open the dev console, it shows the Error:
Expected behavior
There should be no error in the console.
Additional context
Happens in node and in the browser.
The text was updated successfully, but these errors were encountered: