public void run() {
      KeyMap<Action> keyMap = bindActionKey();

      Action action = keyReader.readBinding(keyMap, null, true);
      while (action != null && keepRunning) {
        switch (action) {
          case QUIT:
            keepRunning = false;
            return;
          case SPACE:
            paused = !paused;
            break;
        }
        action = keyReader.readBinding(keyMap, null, true);
      }
    }
A scrolling (logging) view of the query result of a streaming SELECT statement.
samza-sql-shell/src/main/java/org/apache/samza/sql/client/cli/QueryResultLogView.java