immutable.Downloader: pass StorageBroker to constructor, stop being a Service

child of the client, access with client.downloader instead of
client.getServiceNamed("downloader"). The single "Downloader" instance is
scheduled for demolition anyways, to be replaced by individual
filenode.download calls.
This commit is contained in:
Brian Warner
2009-08-15 12:25:43 -07:00
parent 22c962bbc2
commit 4a4a4f9520
7 changed files with 14 additions and 24 deletions

View File

@ -264,7 +264,7 @@ class Client(node.Node, pollmixin.PollMixin):
"private", "cache", "download")
self.download_cache_dirman = cachedir.CacheDirectoryManager(download_cachedir)
self.download_cache_dirman.setServiceParent(self)
self.add_service(Downloader(self.stats_provider))
self.downloader = Downloader(self.storage_broker, self.stats_provider)
self.init_stub_client()
self.init_nodemaker()
@ -323,7 +323,7 @@ class Client(node.Node, pollmixin.PollMixin):
self._secret_holder,
self.get_history(),
self.getServiceNamed("uploader"),
self.getServiceNamed("downloader"),
self.downloader,
self.download_cache_dirman,
self.get_encoding_parameters(),
self._key_generator)