famoseagle-carrot 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/amqp/server.rb +10 -3
- metadata +2 -2
data/VERSION.yml
CHANGED
data/lib/amqp/server.rb
CHANGED
@@ -70,11 +70,11 @@ module Carrot::AMQP
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def read(*args)
|
73
|
-
|
73
|
+
send_command(:read, *args)
|
74
74
|
end
|
75
75
|
|
76
76
|
def write(*args)
|
77
|
-
|
77
|
+
send_command(:write, *args)
|
78
78
|
end
|
79
79
|
|
80
80
|
private
|
@@ -83,6 +83,14 @@ module Carrot::AMQP
|
|
83
83
|
@buffer ||= Buffer.new(self)
|
84
84
|
end
|
85
85
|
|
86
|
+
def send_command(cmd, *args)
|
87
|
+
begin
|
88
|
+
socket.__send__(cmd, *args)
|
89
|
+
rescue Errno::EPIPE, IOError => e
|
90
|
+
raise ServerDown, e.message
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
86
94
|
def socket
|
87
95
|
return @socket if @socket and not @socket.closed?
|
88
96
|
|
@@ -98,7 +106,6 @@ module Carrot::AMQP
|
|
98
106
|
end
|
99
107
|
@status = 'CONNECTED'
|
100
108
|
rescue SocketError, SystemCallError, IOError, Timeout::Error => e
|
101
|
-
kill(e.message)
|
102
109
|
raise ServerDown, e.message
|
103
110
|
ensure
|
104
111
|
mutex.unlock if multithread?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: famoseagle-carrot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amos Elliston
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-04-
|
12
|
+
date: 2009-04-15 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|