Skip to content

Commit

Permalink
Flush out DeferrableBody queue before closing (DeferrableBody#succeed)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed Dec 16, 2008
1 parent e56cdf6 commit 0a4a4e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions example/async_tailer.ru
Expand Up @@ -17,6 +17,12 @@ class DeferrableBody

def initialize
@queue = []
# make sure to flush out the queue before closing the connection
callback{
until @queue.empty?
@queue.shift.each{|chunk| @body_callback.call(chunk) }
end
}
end

def schedule_dequeue
Expand Down

0 comments on commit 0a4a4e9

Please sign in to comment.