def __init__(self, uri='mongodb://localhost:27017/', db="_bo", url_collection='_urls', documents_collection='_docs'): self._mongo = Mongo(uri, db, url_collection, documents_collection) self._job = None self.idle = None self.reset()
def __init__(self, pidfile='/tmp/worker.pid', uri='mongodb://localhost:27017/', db="_bo", url_collection='_urls', documents_collection='_docs', sleep_time=0.1): super(Worker, self).__init__(pidfile) self._mongo = Mongo(uri, db, url_collection, documents_collection) self.sleep_time = sleep_time self._callback = None self.bandwidth = 0