README.md in daemon_runner-0.3.0 vs README.md in daemon_runner-0.4.0

- old
+ new

@@ -146,9 +146,32 @@ def schedule [:interval, options[:loop_sleep_time]] end ``` +### Retries +Simple interface to retry requests that are known to fails sometimes. To add a retry wrap the code like this: + +``` +DaemonRunner::RetryErrors.retry do + my_not_so_good_network_service_that_fails_sometimes +end +``` + +* `options` - Options hash to pass to `retry` (**optional**) + * :retries - Number of times to retry an exception (**optional**, _default_: 3) + * :exceptions - Array of exceptions to catch and retry (**optional**, _default_: `[Faraday::ClientError]`) + +### Locking +Locking can be done either via an exclusive lock or a semaphore lock. The major difference is that with a semaphore lock you can define how many nodes can obtain the lock. + +#### Exclusive Lock +**TBD** + +#### Semaphore Lock +For an example of how to implement semaphore locking take a look at the [example](/examples/example_semaphore.rb) + + ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).