stomper 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -2
- data/lib/stomper/client.rb +12 -11
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -64,5 +64,5 @@ API compatibility with the original gem, and thus Stomper was conceived.
|
|
64
64
|
|
65
65
|
Primary Author:: Ian D. Eccles
|
66
66
|
Source Repository:: http://github.com/iande/stomper
|
67
|
-
Current Version:: 0.
|
68
|
-
Last Updated::
|
67
|
+
Current Version:: 0.3.1
|
68
|
+
Last Updated:: 2010-03-04
|
data/lib/stomper/client.rb
CHANGED
@@ -196,18 +196,19 @@ module Stomper
|
|
196
196
|
def start
|
197
197
|
@connection.connect unless connected?
|
198
198
|
return self if receiving?
|
199
|
+
start_thread = false
|
199
200
|
@receiver_lock.synchronize do
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
201
|
+
@receiving = true
|
202
|
+
start_thread = @run_thread.nil?
|
203
|
+
end
|
204
|
+
if start_thread
|
205
|
+
@run_thread = Thread.new do
|
206
|
+
while receiving?
|
207
|
+
# This was running a little too tightly...
|
208
|
+
# still not terribly happy with this approach, event driven
|
209
|
+
# receiving would be better than polling.
|
210
|
+
receive
|
211
|
+
sleep(1.0)
|
211
212
|
end
|
212
213
|
end
|
213
214
|
end
|