Skip to content

Commit

Permalink
issue #550: fix README to document start rather than unpause
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinDKelley committed Dec 31, 2021
1 parent 029d60e commit 177125d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,23 @@ The callback receives **three** array parameters: `modified`, `added` and `remov
Each of these three is always an array with 0 or more entries.
Each array entry is an absolute path.

### Pause / unpause / stop
### Pause / start / stop

Listeners can also be easily paused/unpaused:
Listeners can also be easily paused and later un-paused with start:

``` ruby
listener = Listen.to('dir/path/to/listen') { |modified, added, removed| puts 'handle changes here...' }

listener.start
listener.paused? # => false
listener.paused? # => false
listener.processing? # => true

listener.pause # stops processing changes (but keeps on collecting them)
listener.paused? # => true
listener.pause # stops processing changes (but keeps on collecting them)
listener.paused? # => true
listener.processing? # => false

listener.unpause # resumes processing changes ("start" would do the same)
listener.stop # stop both listening to changes and processing them
listener.start # resumes processing changes
listener.stop # stop both listening to changes and processing them
```

Note: While paused, `listen` keeps on collecting changes in the background - to clear them, call `stop`.
Expand Down

0 comments on commit 177125d

Please sign in to comment.