Skip to content

Commit

Permalink
Merge pull request #4 from Martin91/update-readme
Browse files Browse the repository at this point in the history
update readme with listener's class methods
  • Loading branch information
krisleech committed May 19, 2015
2 parents 06b80c2 + 8fd1353 commit fc5a529
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -23,6 +23,15 @@ publisher.subscribe(MyListener, async: true)
The listener must be a class (or module), not an object. This is because Sidekiq
can not reconstruct the state of an object. However a class is easily reconstructed.

Additionally, you should also ensure that your methods used to handle events under `MyListener` are all declared as class methods:

```ruby
class MyListener
def self.event_name
end
end
```

When publshing events the arguments must be simple as they need to be
serialized. For example instead of sending an `ActiveRecord` model as an argument
use its id instead.
Expand Down

0 comments on commit fc5a529

Please sign in to comment.