Add some better error handling with named pid `receive()` and `receive_forever()`
This is all kind of assuming that there can only be one pid registered to a name, but I think that's correct?
doesn't add a named process receive_forever test but I can add that in as well pretty easily.
this currently doesn't handle the possibility of:
- main process is registered to a name
- main process gets sent some data
- the name gets re-registered to a different process
- the main process then tries
receive()ing on the named subject, to get the data that's existed on the mailbox - previous behavior: would succeed, and allow any number of
receive()s on names that the process is not registered to. current behavior: fails because the process is not registered to the name, even if there is some data for it in the mailbox. maybe this warrants areceive_unchecked()?
Hello!
That's an interesting point about messages in the inbox from a previously registered name. I wonder what would be best to do about that.
That's an interesting point about messages in the inbox from a previously registered name. I wonder what would be best to do about that.
maybe just verify that the subject is owned by the current process on subject creation, store it within the namedsubject & then assume it's receivable on?
could also just give out a warning? or something? if receive is run on a non-owned named subject
That would mean that only the subject owner could make the subject, which would defeat the purpose of names!
How about we document that a selector can be used if they want to avoid this check.