Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue #550: fix README to document start rather than unpause #551

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
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