Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
konalegi committed Dec 13, 2019
1 parent be5fc3a commit 37dfbf3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ Firstly you should define consumer, Example of consumer

```ruby
class V1::PaymentOrdersConsumer
include Asynk::Consumer
include Asynk::Consumer

set_consume 'sample_app.v1.users.create', 'sample_app.v1.users.notifications'

set_queue_options ack: true
set_subscribe_arguments manual_ack: true
set_concurrency 2
set_route_ending_as_action true
set_route_ending_as_action true

# handling asynchronous request from amqp
def notifications(params)
def notifications(params)
# do here some works
ensure
ack! # required if you manually processing acknowledgments, available methods reject!, requeue!
Expand Down Expand Up @@ -132,7 +132,7 @@ Example using with Rails and MiniTest.
```ruby
# test_helper.rb
class ActiveSupport::TestCase
# include the test helper.
# include the test helper.
include Asynk::TestHelper

# wrapping the response with Asynk::Response class, otherwise it will be just string value.
Expand All @@ -142,14 +142,14 @@ Example using with Rails and MiniTest.
end


# some_consumer_test.rb
# some_consumer_test.rb

test 'should show profile' do
publish_sync 'some_route', { name: 'Chris' }

assert asynk_response.success? # testing for status of the response
assert asynk_response[:unread_messages] # testing the returned data
assert asynk_response[:unread_message_count]
assert asynk_response[:unread_message_count]
end
```
## Disabling consumers
Expand Down Expand Up @@ -188,3 +188,5 @@ Asynk.config[:ignored_consumers] = ENV['IGNORED_CONSUMERS'].delete(' ').split(',
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

sdasdasd

0 comments on commit 37dfbf3

Please sign in to comment.