Skip to content

Commit

Permalink
[custom-handler] changelog and readme updates
Browse files Browse the repository at this point in the history
  • Loading branch information
0exp committed Jun 5, 2024
1 parent 8d6280d commit f291751
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.

## [0.15.0] - 2024-06-05
### Added
- Support for custom reciving handler via `Rabbit.config.handler_resolver_callable` config;

## [0.14.0] - 2023-02-27
### Added
- Exception notifier is required
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ Rabbit.publish(
to teardown and setup external connections between daemon restarts, for example ORM connections
- After the server runs, received messages are handled by `Rabbit::EventHandler` subclasses in two possible ways:
a) Subclasses are selected by following code(by default):
```ruby
"rabbit/handler/#{group_id}/#{event}".camelize.constantize
```
b) you can change default behaviour to your own logic by setting the `handler_resolver_callable` config option with a `Proc` that should return the handler class:
```ruby
Rabbit.config.handler_resolver_callable = -> (group_id, event) { "recivers/#{group_id}/#{event}".camelize.constantize }
```
- a) Subclasses are selected by following code(by default):
```ruby
rabbit/handler/#{group_id}/#{event}".camelize.constantize
```
- b) you can change default behaviour to your own logic by setting the `handler_resolver_callable` config option with a `Proc` that should return the handler class:
```ruby
Rabbit.config.handler_resolver_callable = -> (group_id, event) { "recivers/#{group_id}/#{event}".camelize.constantize }
```
They use powerful `Tainbox` api to handle message data. Project_id also passed to them.
Expand Down

0 comments on commit f291751

Please sign in to comment.