Updates docs

This commit is contained in:
Brusk Awat 2022-12-01 22:14:55 +03:00
parent b9528c66bf
commit 0a4e8b052f
Signed by: broosk1993
GPG Key ID: 5D20F7E02649F74E
2 changed files with 23 additions and 1 deletions

View File

@ -1,7 +1,7 @@
PATH
remote: .
specs:
rabbit_carrots (0.1.13)
rabbit_carrots (0.1.14)
bunny (>= 2.19.0)
connection_pool (~> 2.3.0)

View File

@ -43,6 +43,28 @@ end
Note that handler is a class that must implement a method named ```handle!``` that takes 4 parameters as follow:
```ruby
class DummyEventHandler
def self.handle!(channel, delivery_info, properties, payload)
# Handle the received message from the queue
end
end
```
Inside the handle message, you can NACK the message without re-queuing by raising ```RabbitCarrots::EventHandlers::Errors::NackMessage``` exception.
To NACK and re-queue, raise ```RabbitCarrots::EventHandlers::Errors::NackAndRequeueMessage``` exception.
If no errors are thrown, the message will be acknowledged soon after the ```handle!``` method returns.
Note: Any other unrescued exception raised inside ```handle!``` the that is a subclass of ```StandardError``` will trigger a NACK and re-queue.
### Running
Then run ```bundle exec rake rabbit_carrots:eat```.
## Development