rack-amqp-client 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30238824d47466532279b8b590398aae97cb2509
4
- data.tar.gz: ae448f75f2c128b8d763589a0ec9a34b82becfa5
3
+ metadata.gz: d0b8d316b9b073a11e8738944e6688a1a70f1509
4
+ data.tar.gz: 14a3f4d9a092f9e6624b7906b3c40a8604fd7b9d
5
5
  SHA512:
6
- metadata.gz: 5155f4e74042b4bab9bfa70535316e5e750e509a53f93e334df57890ea7694cbcd1050eb9cdc72655c584ee37312001b2d86565aa2bbe1072c9b499879365851
7
- data.tar.gz: fddbb1638cb849b8db3fa95cf2838e47f9c0cc5d43e28cecbbaa5b5405f19fe69c6bd0d31c29d37b0f6683a3d0d7116d485218335b21c4e862bf9ca7abe77fe3
6
+ metadata.gz: 1d561e0edbf319f79955c075f7d8acc6a8779b6ecd7fabd4b3bbb430fd90b2c5003f3337f24e282a3a435f4b25323c30bad356ba2574346133717cde6ed00832
7
+ data.tar.gz: 551a632ce05b34f1fd387660b66a5fc2255a83d1b809e85b489d6bb4a8679ef07b6756cd88048d3658372af08005fee01bc348fd31dacf395e72b4e491f941da
@@ -33,5 +33,6 @@ end
33
33
 
34
34
  require "rack/amqp/client/request"
35
35
  require "rack/amqp/client/response"
36
+ require "rack/amqp/client/null_response"
36
37
  require "rack/amqp/client/manager"
37
38
  require "rack/amqp/client/version"
@@ -24,13 +24,17 @@ module Rack
24
24
 
25
25
  request = Request.new((@correlation_id += 1).to_s, http_method, uri, body, headers)
26
26
  @mutex.synchronize { @incomplete_requests << request }
27
+
27
28
  callback_queue = create_callback_queue
28
29
  request.callback_queue = callback_queue
29
30
 
30
31
  amqp_channel.direct('').publish(request.payload, request.publishing_options)
31
32
 
32
- response = request.reply_wait(timeout)
33
- response
33
+ if options[:async]
34
+ NullResponse.new
35
+ else
36
+ request.reply_wait(timeout)
37
+ end
34
38
  end
35
39
 
36
40
  private
@@ -51,7 +55,7 @@ module Rack
51
55
  end
52
56
  # bind to an exchange, maybe later
53
57
  queue
54
- end
58
+ end
55
59
  end
56
60
 
57
61
  def connect!(broker_options)
@@ -0,0 +1,15 @@
1
+ module Rack
2
+ module AMQP
3
+ module Client
4
+ class NullResponse < Response
5
+ def initialize(meta = {}, payload = {}, delivery_info = nil)
6
+ super
7
+ @meta[:headers] ||= {}
8
+ @meta[:headers]['X-AMQP-HTTP-Status'] = 200
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
14
+
15
+
@@ -1,7 +1,7 @@
1
1
  module Rack
2
2
  module AMQP
3
3
  module Client
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
6
6
  end
7
7
  end
@@ -23,5 +23,4 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "rake"
24
24
  spec.add_development_dependency "rspec"
25
25
  spec.add_development_dependency "pry"
26
- spec.add_development_dependency "emoji-rspec"
27
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-amqp-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Szmajda
@@ -9,90 +9,76 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-18 00:00:00.000000000 Z
12
+ date: 2014-11-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bunny
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ~>
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
34
  version: '1.3'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ~>
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
41
  version: '1.3'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rake
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rspec
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - '>='
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: pry
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - '>='
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - '>='
82
- - !ruby/object:Gem::Version
83
- version: '0'
84
- - !ruby/object:Gem::Dependency
85
- name: emoji-rspec
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - '>='
89
- - !ruby/object:Gem::Version
90
- version: '0'
91
- type: :development
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - '>='
81
+ - - ">="
96
82
  - !ruby/object:Gem::Version
97
83
  version: '0'
98
84
  description: An AMQP-HTTP ruby client
@@ -102,9 +88,8 @@ executables: []
102
88
  extensions: []
103
89
  extra_rdoc_files: []
104
90
  files:
105
- - .gitignore
106
- - .rspec
107
- - .travis.yml
91
+ - ".gitignore"
92
+ - ".travis.yml"
108
93
  - CHANGELOG.md
109
94
  - Gemfile
110
95
  - LICENSE
@@ -113,6 +98,7 @@ files:
113
98
  - Rakefile
114
99
  - lib/rack/amqp/client.rb
115
100
  - lib/rack/amqp/client/manager.rb
101
+ - lib/rack/amqp/client/null_response.rb
116
102
  - lib/rack/amqp/client/request.rb
117
103
  - lib/rack/amqp/client/response.rb
118
104
  - lib/rack/amqp/client/version.rb
@@ -129,12 +115,12 @@ require_paths:
129
115
  - lib
130
116
  required_ruby_version: !ruby/object:Gem::Requirement
131
117
  requirements:
132
- - - '>='
118
+ - - ">="
133
119
  - !ruby/object:Gem::Version
134
120
  version: '0'
135
121
  required_rubygems_version: !ruby/object:Gem::Requirement
136
122
  requirements:
137
- - - '>='
123
+ - - ">="
138
124
  - !ruby/object:Gem::Version
139
125
  version: '0'
140
126
  requirements: []
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --require emoji-rspec
2
- --format hearts