title: Java behavior of Observer class on being notified multiple times
body: <p>I wanted to know what happens when an Observer is notified multiple times while it's still executing overridden method update(Observable observable, Object obj).</p>
  
  <p>I have a concrete Observable class: </p>
  
  <pre><code>public class HttpRequestQueue extends Observable{
  
  //an example queue(for explanation) and other class members
  public Queue queue..
  
  public void addToQueue(HttpRequest request){
      queue.add(request);
      setChanged();
      notifyObservers();
  }
  
  }
  </code></pre>
  
  <p>Another class which is the Observer</p>
  
  <pre><code>public class Webclient implements Observer{
  
  @Override
  public void update(Observable observable, Object data) {
  
  while (!observable.queue.isEmpty()){
  
       //NETWORK OPERATION!!  
       processRequest(queue.remove());
  }
  
  }
  
  }
  </code></pre>
  
  <p>This is the main class:</p>
  
  <pre><code>public static main(){
  
  HttpRequestQueue qu = new HttpRequestQueue();
  Webclient wClient = new WebClient();
  
  qu.addObserver(wClient);
  
  //Now start other application operations
  qu.add(new HttpRequest(...)); //Observer's update will be called 1st time
  qu.add(new HttpRequest(...)); //Observer's update will be called 2nd time
  qu.add(new HttpRequest(...)); //Observer's update will be called 3rd time
  }
  </code></pre>
  
  <p>Now what will be the behavior of the Observer Webclient's update() as when it will be  called for the second time, the execution of the first wouldn't have ended.</p>
  
  <p>Sorry if I sound like a dumb.</p>