sevak 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ba1b1f19dfedbf1f09684c3f20bf0961b43ab8e
4
- data.tar.gz: 6e009c195d675174db7bea30d5d9545e431c3a66
3
+ metadata.gz: f9e20251448ad957b60dd439f8338f72f41da5b0
4
+ data.tar.gz: 41f97d0eaa1491beb956e2308c34d47ab97cdd7f
5
5
  SHA512:
6
- metadata.gz: 8110cea597ffa6e22441f222a6e793599047a5707dc4b2c71993d8e3cad37a369eb7269ec31ccbdec2432fe58b64d8c3f0ed537c3ea3ab16ab5402443583dd0b
7
- data.tar.gz: 901110f1a5d8700e8cbf3a32d9a04985dcca4b0339f6b51ad8abb11cde0f668bebd7f3f6a538ab62b0783ca5ef954f9b3d72a18119ce8b33cc5dead1fc9c369c
6
+ metadata.gz: cf78a97bd5aaf0723d5c056fd983b18e30d0861b63f65032069905d79d117e0dfb4a1ed09954e18c1b932f4c99eab79862ff961a4a5e5554ab7d39cd3ff69acc
7
+ data.tar.gz: 581a76b9126a3fbf3e31259ccf7d9bed7ea84478518f671f4891b0a6aace638ada82090ce4f7278496024d1c06a411337b2739e48b61041eff16fb394ad58c9e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sevak (0.4.0)
4
+ sevak (0.4.1)
5
5
  bunny
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,34 +1,34 @@
1
1
  Sevak gem makes it easy to send and receive messages from rabbitmq queues. It is built on top of the bunny gem.
2
2
  It also supports delayed queuing using [rabbitmq delayed exchange plugin](https://github.com/rabbitmq/rabbitmq-delayed-message-exchange)
3
3
 
4
- Usage:
4
+ # Dependencies
5
5
 
6
- Dependencies
6
+ * [rabbitmq delayed exchange plugin](https://github.com/rabbitmq/rabbitmq-delayed-message-exchange):
7
7
 
8
- * [rabbitmq delayed exchange plugin](https://github.com/rabbitmq/rabbitmq-delayed-message-exchange)
9
8
  To install this plugin:
10
- 1. Download the latest build for the plugin from [here](http://www.rabbitmq.com/community-plugins.html)
11
- 2. Enable the plugin using command:
12
9
 
13
- rabbitmq-plugins enable rabbitmq_delayed_message_exchange
10
+ 1. Download the latest build for the plugin from [here](http://www.rabbitmq.com/community-plugins.html)
11
+ 2. Enable the plugin using command:
14
12
 
15
- Install
13
+ rabbitmq-plugins enable rabbitmq_delayed_message_exchange
14
+
15
+ # Installation
16
16
 
17
17
  gem install sevak
18
18
 
19
- Configuration
20
- Create a file under `config/initializers` and add following lines to that file:
19
+ # Configuration
21
20
 
22
- Sevak.configure do |f|
23
- f.host = 'localhost'
24
- f.port = '5672'
25
- f.user = 'username'
26
- f.password = 'password'
27
- f.prefetch_count = 10
28
- end
21
+ Create a file under `config/initializers` and add following lines to that file:
29
22
 
23
+ Sevak.configure do |f|
24
+ f.host = 'localhost'
25
+ f.port = '5672'
26
+ f.user = 'username'
27
+ f.password = 'password'
28
+ f.prefetch_count = 10
29
+ end
30
30
 
31
- Usage
31
+ # Usage:
32
32
 
33
33
  ### Publishing to a queue
34
34
 
@@ -38,7 +38,7 @@ To publish any message to a queue use the following syntax:
38
38
 
39
39
  If the queue is not present already it will be created automatically.
40
40
 
41
- Example usage:
41
+ Example:
42
42
 
43
43
  Sevak::Publisher.delayed_publish('sms', message = { name: 'Deepak', msisdn: '9078657543' })
44
44
 
@@ -48,14 +48,14 @@ To publish any message to a queue with some delay use the following syntax:
48
48
 
49
49
  Sevak::Publisher.publish(*queue_name*, *message*, *delay in milliseconds*)
50
50
 
51
- Exaple usage:
51
+ Example:
52
52
 
53
53
  Sevak::Publisher.delayed_publish('sms', message = { name: 'Deepak', msisdn: '9078657543' }, 10000)
54
54
 
55
55
  This will publish the message to an exchange which will route the message to the specified queue with a delay of 10 seconds.
56
56
 
57
- ### Receiving messages from ths queues
58
- To receive message from this queue and process the message create a consumer file inside your project under `app/controllers`.
57
+ ### Receiving messages from the queue
58
+ To receive message from this queue and process the message create a consumer file for each queue in your project under `app/consumers`.
59
59
 
60
60
  class SmsConsumer < Sevak::Consumer
61
61
 
@@ -18,11 +18,11 @@ module Sevak
18
18
  end
19
19
 
20
20
  def queue(queue_name)
21
- @queue ||= channel.queue(queue_name)
21
+ channel.queue(queue_name)
22
22
  end
23
23
 
24
24
  def exchange(queue_name)
25
- @exchange ||= channel.exchange("#{queue_name}_exchange", type: "x-delayed-message", arguments: { "x-delayed-type" => "direct" })
25
+ channel.exchange("#{queue_name}_exchange", type: "x-delayed-message", arguments: { "x-delayed-type" => "direct" })
26
26
  end
27
27
 
28
28
  def publish_exchange(queue_name, message, delay)
data/lib/sevak/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sevak
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sevak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Deepak Kumar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-09 00:00:00.000000000 Z
11
+ date: 2018-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny