Out of band stuff?

Damian Janowski jano at dimaion.com
Mon Apr 9 13:04:26 UTC 2012


On Mon, Apr 9, 2012 at 12:05 AM, Eric Wong <normalperson at yhbt.net> wrote:
> For Raindrops::Watcher, I start a background thread on the first request:
>
>        git clone git://bogomips.org/raindrops.git
>        $EDITOR lib/raindrops/watcher.rb

Great, that should get me started!

> If you look at the `call' method in raindrops/watcher.rb, the important
> line is this:
>
>        # @start is a Mutex and @thr is nil in the initialize method.
>
>        @start.synchronize { @thr ||= aggregator_thread(env["rack.logger"]) }

By the way, why does #aggregator_thread call #wait_snapshot before
returning the thread? (I'm no expert in threading, but my guess is to
wait for the first loop to run correctly?)


More information about the rainbows-talk mailing list