def serial_main(daemon_mode): cache = CorgiCache() while True: feeds = cache.get_all_feeds() for feed in feeds: scrap_feed(feed) if not daemon_mode: break return
def async_main(daemon_mode): pool = Pool() cache = CorgiCache() while True: feeds = cache.get_all_feeds() for feed in feeds: pool.apply_async(func=scrap_feed, args=feed) pool.close() pool.join() if not daemon_mode: break return