Add some better error handling with named pid receive() and receive_forever()#91
Add some better error handling with named pid receive() and receive_forever()#91mjsir911 wants to merge 3 commits intogleam-lang:mainfrom
receive() and receive_forever()#91Conversation
|
this currently doesn't handle the possibility of:
|
|
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. |
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 |
|
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. |
7282e20 to
54f93ee
Compare
| /// *previously* registered to this process, and then got re-registered | ||
| /// to another. | ||
| /// To recieve messages on subjects not directed at the current pid, | ||
| /// use `Select` |
There was a problem hiding this comment.
Correct grammar and punctuation in documentation please 🙏
It doesn't return an error in this case, and there is no thing called Select.
Perhaps something like this:
You may wish to use named subject that was previously owned by the current process, in order to select messages that were received and still reside in the process mailbox. In this case you can use the
selectandselector_receivefunctions instead.
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_forevertest but I can add that in as well pretty easily.