code: @Override
  	public void run() {
  		Collection<Writer> writers = new ArrayList<Writer>(1);
  
  		while (true) {
  			for (Task task : receiveTasks()) {
  				if (task == Task.POISON) {
  					close();
  					return;
  				} else {
  					write(writers, task);
  				}
  			}
  
  			flush(writers);
  			writers.clear();
  
  			try {
  				sleep(MILLISECONDS_TO_SLEEP);
  			} catch (InterruptedException ex) {
  				// Ignore and continue
  			}
  		}
  	}
docs: Fetches log entries and writes them until receiving a poison task.