-
Notifications
You must be signed in to change notification settings - Fork 1
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
Propagate panics cleanly #7
Comments
So I think at the end of the day dropping without sending is a programmer error. In Rust we usually panic on those (Swift takes a bit of a different view on this point – not sure if that's part of the discussion or not). Then we get to a question that does not arise in Swift with its single-type approach: Was that programmer error on the sending side or on the receiving side, or both? In one of my earlier designs, Receiver had an implicit
Those were persuasive to me that it is strictly better to blow up Sender than receiver. If we leave off item 3, which I think is the weakest, it could make sense to poison Receiver as well. But that still leaves your double-panic problem. One idea is to check I am a little unsure how safe that assumption is, in the dark corners of "fully generalized" panic machinery. For example, could it be that: a) |
If the "sending" part panics and drops
Sender
, we get a double panic and a crash.Something else should probably be done here, maybe set a flag (i.e. poison the future), and panic on next poll?
The text was updated successfully, but these errors were encountered: