title: Update multiple MVC's Views on-Model-change with PHP
body: <p>What approach, mechanisms <s>(&amp; probably code)</s> one should apply to fully implement Model-to-View<strong>s</strong> data update (transfer) on Model-State-Change event with pure PHP?</p>
  
  <p><hr>
  <em>If I'm not mistaken,</em> MVC pattern states an implicit requirement for data to be sent from Model layer to <strong>all active</strong> View<strong>s</strong>, specifying that "View is updated on Model change". (otherwise, it doesn't make any sense, as users, working with same source would see its data non-runtime and absolutely disconnected from reality)<br>
  <hr>
  But PHP is a scripting PL, so it's limited to "connection threads" via processes &amp; it's lifetime is limited to request-response cycle (as <a href="https://stackoverflow.com/users/727208/tere%c5%a1ko">tereško</a> kindly noted).  </p>
  
  <p><hr>
  Thus, one has to solve couple issues:  </p>
  
  <ol>
  <li>Client must have a <em>live tunnel</em> connection to server (Server Sent Events),</li>
  <li>Server must be able to <em>push</em> data to client (<code>flush()</code>, <code>ob_flush()</code>),</li>
  <li>Model-State-Change event must be raised &amp; related data packed for transfer,</li>
  <li>(<b>?</b>) Data must be sent to <strong>all</strong> <em>active</em> clients (connected to same exact resource/URL) together, not just one currently working with it's own processes &amp; instance of ModelClass.php file...  </li>
  </ol>
  
  <p><hr>
  <strong>UPDATE 1:</strong> So, it seems that "simultaneous" interaction with multiple users with PHP involves implementation of WEB Server over sockets of some sort, independent of NGINX and others.... Making its core non-blocking I/O, storing connections &amp; "simply" looping over connections, serving data....<br>
  Thus, if I'm not mistaken the easiest way is, still, to go and get some ready solution like Ratchet, be it a 'concurrency framework' or WEB server on sockets...<br>
  Too much overhead for a couple of messages a day, though...<br>
  AJAX short polling seems to be quite a solution for this dilemma....  </p>
  
  <p>Is simultaneous updating multiple clients easier with some different backend than PHP, I wonder?.. Look at C# - it's event-based, not limited to "connection threads" and to query-reply life cycle, if I remember correctly... But it's still WEB (over same HTTP?)...</p>