Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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:

  1. 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
  2. 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?

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.