code: function attach_() {
      var i = 0;
      var intervalId = setInterval(function() {
        if (outputStream.closed) {
          clearInterval(intervalId);
        } else {
          boundEmit(i++);
        }
      }, ms);
    }
docs: Lazily subscribes to a timeout event.