Displaying 1 result from an estimated 1 matches for "importworker".
Did you mean:
import_worker
2008 Jan 13
3
right usage of bdrb
...end
def checksyndicate
syndications = # all Syndication in this hour
syndications.each do |syndication|
MiddleMan.ask_work(:worker => import_worker, :worker_method =>
import, :data => syndication.id)
end
end
- - - - - - -
import_worker.rb
- - - - - - -
class ImportWorker < BackgrounDRb::MetaWorker
set_worker_name :import_worker
def create(args = nil)
# this method is called, when worker is loaded for the first time
end
def import(feedid)
feed = Feed.find_by_id(feedid)
# fetch feed
feed.items.each do |item|
# create item...