I am happy to help extend/fix this problem if someone can point me in the right direction.
Perhaps I misunderstand the implementation, but I am bumping into a problem attempting to reply in the client to a message from the server.
The server can respond to push messages which come into the handle_reply method in the client. But the client cannot respond to push messages from the server. The messages come into the handle_message method for the client, which does not have the from input. The documentation for the client reply is asking for a from GenServer input which doesn't exist on handle_message.
Attempts to reply with anything else than {:ok, state} or {:connect, state} returns an error from the handle_message in the client and the responses do not make it to the server.
I am attempting to use this for realtime messaging. Sending a request to a client to update configuration and wanting to a receive a reply to that message. The work around currently is publishing a different message #{original_message}_reply but this feels like it isn't using the built-in benefits of the socket.
Any advice? Known shortcomings? Pointers for how one would make this work? Suggestions for improving this project?
I am happy to help extend/fix this problem if someone can point me in the right direction.
Perhaps I misunderstand the implementation, but I am bumping into a problem attempting to reply in the client to a message from the server.
The server can respond to
pushmessages which come into thehandle_replymethod in the client. But the client cannot respond topushmessages from the server. The messages come into thehandle_messagemethod for the client, which does not have thefrominput. The documentation for the clientreplyis asking for afromGenServer input which doesn't exist onhandle_message.Attempts to reply with anything else than
{:ok, state}or{:connect, state}returns an error from thehandle_messagein the client and the responses do not make it to the server.I am attempting to use this for realtime messaging. Sending a request to a client to update configuration and wanting to a receive a reply to that message. The work around currently is publishing a different message
#{original_message}_replybut this feels like it isn't using the built-in benefits of the socket.Any advice? Known shortcomings? Pointers for how one would make this work? Suggestions for improving this project?