code: protected boolean handleEvent(AbstractEvent event) throws IOException {
  		final Class<?> eventType = event.getClass();
  
  		try {
  			// ------------------------------------------------------------
  			// Runtime events
  			// ------------------------------------------------------------
  
  			// This event is also checked at the (single) input gate to release the respective
  			// channel, at which it was received.
  			if (eventType == EndOfPartitionEvent.class) {
  				return true;
  			}
  			else if (eventType == EndOfSuperstepEvent.class) {
  				return incrementEndOfSuperstepEventAndCheck();
  			}
  
  			// ------------------------------------------------------------
  			// Task events (user)
  			// ------------------------------------------------------------
  			else if (event instanceof TaskEvent) {
  				taskEventHandler.publish((TaskEvent) event);
  
  				return false;
  			}
  			else {
  				throw new IllegalStateException("Received unexpected event of type " + eventType + " at reader.");
  			}
  		}
  		catch (Throwable t) {
  			throw new IOException("Error while handling event of type " + eventType + ": " + t.getMessage(), t);
  		}
  	}
docs: Handles the event and returns whether the reader reached an end-of-stream event (either the
  end of the whole stream or the end of an superstep).