search for: data_mutex

Displaying 1 result from an estimated 1 matches for "data_mutex".

Did you mean: dapm_mutex
2008 Mar 25
0
Questions about backgroundrb
..., we will send following data to the worker: MiddleMan.worker(:myspace_worker).crawl_page(:page_name => "social_revolution",:user_id => x) Where crawl_page is a method inside MyspaceWorker. class MyspaceWorker<BackgrounDRb::MetaWorker def create @crawled_data = {} @data_mutex = Mutex.new end def crawl_page options = {} thread_pool.defer(options) { start_crawling(options)} end def start_crawling options # do your page crawling here result = magical_crawl(options[:page_name]) # since multiple threads may write to the same hash, lets protect it wi...