]> git.cworth.org Git - sup/blobdiff - lib/sup/poll.rb
many many changes. this is what happens when i have 5 hours on an airplane
[sup] / lib / sup / poll.rb
index 2faadfe87634d6f1d31bf3ebd0e870d2fa19bb06..387f06e34af5ef7665c2cf3f749ab8c8770b504e 100644 (file)
@@ -39,7 +39,8 @@ EOS
   end
 
   def buffer
-    @buffer ||= BufferManager.spawn_unless_exists("<poll for new messages>", :hidden => true) { PollMode.new }
+    b, new = BufferManager.spawn_unless_exists("<poll for new messages>", :hidden => true) { PollMode.new }
+    b
   end
 
   def poll
@@ -62,7 +63,7 @@ EOS
   end
 
   def start
-    @thread = Redwood::reporting_thread do
+    @thread = Redwood::reporting_thread("periodic poll") do
       while true
         sleep DELAY / 2
         poll if @last_poll.nil? || (Time.now - @last_poll) >= DELAY