README.md in salesforce_streamer-2.2.0 vs README.md in salesforce_streamer-2.3.0
- old
+ new
@@ -181,11 +181,26 @@
out more about extensions from
[Faye](https://github.com/faye/faye/blob/master/spec/ruby/server/extensions_spec.rb)
specs.
Any configured extensions are added to the Faye client used by the Restforce
-client when starting up the server.
+client when starting up the server. If the extension responds to `.server=` then
+the instance of `SalesforceStreamer::Server` is assigned. This may be convenient
+to restart the server subscriptions if an error requires a reset.
+```ruby
+class MyRestartFayeExtension
+ attr_accessor :server
+
+ def incoming(message, callback)
+ callback.call(message).tap |message|
+ server.restart if message['error'] == 'tragic'
+ end
+ end
+end
+
+SalesforceStreamer.config.use_faye_extension MyRestartFayeExtension.new
+```
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` 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).