public RemoteInterpreterEvent pollEvent(){
synchronized (eventQueue) {
    if (eventQueue.isEmpty()) {
      try {
        eventQueue.wait(1000);
      }
 catch (      InterruptedException e) {
      }
    }
    if (eventQueue.isEmpty()) {
      return new RemoteInterpreterEvent(RemoteInterpreterEventType.NO_OP,"");
    }
 else {
      RemoteInterpreterEvent event=eventQueue.remove(0);
      logger.debug("Send event {}",event.getType());
      return event;
    }
  }
}

public RemoteInterpreterEvent pollEvent ( ) { synchronized ( eventQueue ) { if ( eventQueue . isEmpty ( ) ) { try { eventQueue . wait ( 1000 ) ; } catch ( InterruptedException e ) { } } if ( eventQueue . isEmpty ( ) ) { return new RemoteInterpreterEvent ( RemoteInterpreterEventType . NO_OP , "" ) ; } else { RemoteInterpreterEvent event = eventQueue . remove ( 0 ) ; logger . debug ( "Send event {}" , event . getType ( ) ) ; return event ; } } }
supposed to call from remoteinterpretereventpoller
