stomper 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.rdoc +2 -2
  2. data/lib/stomper/client.rb +12 -11
  3. 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.2.0
68
- Last Updated:: 2009-12-11
67
+ Current Version:: 0.3.1
68
+ Last Updated:: 2010-03-04
@@ -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
- if @run_thread.nil?
201
- @receiving = true
202
- @run_thread = Thread.new do
203
- while receiving?
204
- #begin
205
- receive
206
- #rescue => err
207
- #puts "Exception Caught: #{err.to_s}"
208
- #break
209
- #end
210
- end
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
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 0
9
- version: 0.3.0
8
+ - 1
9
+ version: 0.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ian D. Eccles