I'm looking for concepts, approaches or even Framework/libraries to help me synchronize state reliably from web UI to a third Party Service.
For example: creating a JavaScript irc Client ui you need an own backend to handle the IRC connection.
The IRC protocol is asynchronous in a way that you send a command to the server and then the server will eventually answer with an event changing the state of your irc connection.
In similar ways the JavaScript/web UI is asynchronous when it comes to reflecting changes in that state.
From my understanding there are two main issues I am having with implementing something like this.
Usecase: Joining a channel:
- In JavaScript UI I enter a command which will trigger an AJAX(?) call. On the server this request triggers an execution of an IRC command. At this point I Need to have an eventlistener for the possible answers a server could give me and determine whether I have joined the given channel or not. This ideally should result in the ui being updated with either an error message or an opening channel window
- In IRC you could also be invited by someone to join a channel, or your could be kicked from a channel. Then you have to react to the irc connection state changes and update the ui accordingly
Is this a solved problem?