Skip to content

Pause tailing the file #48

@JYone3A

Description

@JYone3A

Hi,

I wonder if it would be possible to include a pause and resume method.

I am assuming that it should be fairly simple:

pause() {
  if (this[kQuitting]) return
  
  clearTimeout(this[kPollTimer])
  this.paused = true
}

async resume() {
  if (!this.paused) return
  
  this[kStartPos] = null
  this.paused = false
  
  this._pollFileForChanges()
}

Side quesion: Is the assumption correct that I always (also for the pause/resume case above) get a flush event before any data, therefore I am always able to get lastReadPosition first (I need the exact start byte for each chunk).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions