title: Asynchronous update of model in MVC
body: <p>I have a simple MVC implemented in Javascript. The View only does one thing: captures the coordinates of mouse clicks. Whenever the user clicks, the View saves the coordinates in a FIFO buffer and notifies the Controller about this new event. As result of the notification, the Controller reads the coordinates and asks the Model about some data that is specific for those coordinates. This data is just a simple number.</p>
  
  <p>However, the Model does not actually have that data. The Model asks a remote server for that information. When the information (asynchronously) arrives, the Model saves the information in a permanent buffer and notifies the Controller which should refresh the view based on this new information.</p>
  
  <p>Unfortunately, the entire buffer in the Model has to be processed so that the View can be refreshed (the View cannot be refreshed based only on the last data). My doubt is, what happens if a new data arrives asynchronously while the buffer in the Model is being read in order to refresh the View? My first thought was to make one entire stable copy of the database for each View refresh.</p>