Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some change #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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