-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
EventStream panics on emit from another thread #278
Comments
To clarify that issue, emitting on another thread will not always panic. Consider for example a modified multithread-example, where the calculation label is a saparate widget. Creating a method to check if the stream is closed can lead to a race condition, so it is no real solution:
I would have a few suggestions on how to fix this issue, but each has some problems: Solution 1Just remove the else-clause with the Problems: Maybe someone might want to know if the message was sent (maybe for logging). Solution 2Make Problems: Will break compatibility to earlier versions. It would probably be tedious to write Solution 3Make Problems: As Solution 4Make some function returning a reference to the Problem: This will make ResultEvery single solution has some problems. Furthermore, the first three solutions have a problem with Other solutions are obviously welcome. |
This is probably not what we want.
There should be a way to check if the stream is closed.
The text was updated successfully, but these errors were encountered: