-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Duplex messaging between client and server #317
Comments
How this approach differs from the regular RPC call from client to server? |
This is different from low-level implementation, because there will be metadata in a packet as well. So packet will be recognized by metadata. In some cases, we need async messaging, e.g. some user activity tracking. So basically RPC - remote procedure call. We run procedure in server and expecting response/error within the call directly. Async messaging - we don't care about immediate response. Notifications, user's actions tracking, any similar functionality |
|
Let me clarify - by saying low level implementation I mean |
The alternative solution just brought confusion to the topic. I removed it. So speaking about proposed solution. It is just mirroring existing functionality, and of course I see this useful to have in metacom. So developer don't need to go to a low level at all and stay within the metacom only, cause metacom is a high-level network library compare to raw WS |
Server-side, we have no direct link to a WS connection available. This would break our abstraction layers. So we need to have such functionality implemented. For client, I am sure it is the same. By design, we don't need to go directly to a WS connection, just to not break abstraction layers/ |
@tshemsedinov |
Client code is ok for me, but server-side event handler I'd like to have, for example, file ({ message }) => {
if (message === 'hello') {
context.client.emit('interfaceName/event', 'hi');
}
}; |
Can we implement server-side event handlers as it is? |
Is your feature request related to a problem? Please describe.
We now have only one way messaging via metacom,
But nothing to receive messages from clients server side and nothing to send events to a server from client.
Describe the solution you'd like
I propose to enhance existing functionality with this solution:
Additional context
@tshemsedinov @rohiievych please suggest your alternatives, if anything can be done better.
The text was updated successfully, but these errors were encountered: