-
Notifications
You must be signed in to change notification settings - Fork 109
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
port: add helper function for parsing message tuple #997
Conversation
a2cc409
to
cf1fbdd
Compare
1b313b1
to
47c8c60
Compare
4332144
to
7358e20
Compare
17fb7de
to
14197e2
Compare
Remove duplicate code and add checks. Signed-off-by: Davide Bettio <davide@uninstall.it>
Future proof #2: return the type of message instead of a generic Ok value. Right now we support only calls. Signed-off-by: Davide Bettio <davide@uninstall.it>
1cfd28b
to
804ff69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
term pid; | ||
term ref; | ||
} GenMessage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all messages will have a ref or even a pid. Are we okay with this? I am fine with it, and I consider this a kind of interim solution, so that's fine. Just thinking ahead to what an $info
or $cast
message would look like.
This is just an observation, not a change request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case GenCastMessage
instead of GenCallMessage
will be returned (pid and ref will be invalid).
Add function for hiding port message tuple format details, so code doesn't need to hardcode indexes or repeat always the same checks, that can be instead shared across different port drivers.
These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).
SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later