README.md in wisper-2.0.0 vs README.md in wisper-2.0.1
- old
+ new
@@ -8,14 +8,16 @@
[![Coverage Status](https://coveralls.io/repos/krisleech/wisper/badge.svg?branch=master)](https://coveralls.io/r/krisleech/wisper?branch=master)
* Decouple core business logic from external concerns in Hexagonal style architectures
* Use as an alternative to ActiveRecord callbacks and Observers in Rails apps
* Connect objects based on context without permanence
-* React to events synchronously or asynchronously
+* Publish events synchronously or asynchronously
Note: Wisper was originally extracted from a Rails codebase but is not dependant on Rails.
+Please also see the [Wiki](https://github.com/krisleech/wisper/wiki) for more additional information and articles.
+
## Installation
Add this line to your application's Gemfile:
```ruby
@@ -72,11 +74,11 @@
```ruby
class OrderNotifier
def cancel_order_successful(order_id)
order = Order.find_by_id(order_id)
- # notify someone ...
+ # notify someone ...
end
end
```
#### Blocks
@@ -116,12 +118,13 @@
```
Wisper has various adapters for asynchronous event handling, please refer to
[wisper-celluloid](https://github.com/krisleech/wisper-celluloid),
[wisper-sidekiq](https://github.com/krisleech/wisper-sidekiq),
-[wisper-activejob](https://github.com/krisleech/wisper-activejob), or
-[wisper-que](https://github.com/joevandyk/wisper-que).
+[wisper-activejob](https://github.com/krisleech/wisper-activejob),
+[wisper-que](https://github.com/joevandyk/wisper-que) or
+[wisper-resque](https://github.com/bzurkowski/wisper-resque).
Depending on the adapter used the listener may need to be a class instead of an object. In this situation, every method corresponding to events should be declared as a class method, too. For example:
```ruby
class OrderNotifier
@@ -129,11 +132,11 @@
# cancel_order.subscribe(OrderNotifier)
#
def self.cancel_order_successful(order_id)
order = Order.find_by_id(order_id)
- # notify someone ...
+ # notify someone ...
end
end
```
### ActionController
@@ -189,14 +192,15 @@
```ruby
Wisper.subscribe(MyListener.new)
```
-In a Rails app you might want to add your global listeners in an initalizer.
+In a Rails app you might want to add your global listeners in an initializer.
-Global listeners are threadsafe.
+Global listeners are threadsafe. Subscribers will receive events published on all threads.
+
### Scoping by publisher class
You might want to globally subscribe a listener to publishers with a certain
class.
@@ -229,11 +233,11 @@
Any events broadcast within the block by any publisher will be sent to the
listeners.
This is useful for capturing events published by objects to which you do not have access in a given context.
-Temporary Global Listeners are threadsafe.
+Temporary Global Listeners are threadsafe. Subscribers will receive events published on the same thread.
## Subscribing to selected events
By default a listener will get notified of all events it can respond to. You
can limit which events a listener is notified of by passing a string, symbol,
@@ -289,11 +293,11 @@
You could also alias the method within your listener, as such
`alias successful create_report_successful`.
## Testing
-Testing matchers and stubs are in seperate gems.
+Testing matchers and stubs are in separate gems.
* [wisper-rspec](https://github.com/krisleech/wisper-rspec)
* [wisper-minitest](https://github.com/digitalcuisine/wisper-minitest)
### Clearing Global Listeners
@@ -337,9 +341,10 @@
## Security
* gem releases are [signed](http://guides.rubygems.org/security/) ([public key](https://github.com/krisleech/wisper/blob/master/gem-public_cert.pem))
* commits are GPG signed ([public key](https://pgp.mit.edu/pks/lookup?op=get&search=0x3ABC74851F7CCC88))
+* My [Keybase.io profile](https://keybase.io/krisleech)
## License
(The MIT License)