It is possible (likely) that a manage call is in progress when
`stop` is called. When that happens, _manage will continue to
run, and schedule another call - and the manager won't actually stop,
and will likely cause an error as other components have been torn down.
This fix adds a deferred that gets created when a manage call starts
and is fired when its done. At this points its safe to start the
stopping process. Also add a check to not schedule another manage
call if we're stopped
This fixes https://app.asana.com/0/142330900434470/239832897034382
In the next commit I change conf.settings to be initialized
at runtime instead of load time and so any import of
`from lbrynet.conf import settings` will be and stay None if
it happens before the initialization.
Ran into a situation where I was recieving an offer response without
something in protocol_offers. I think this was because
get_and_set_rate doesn't always populate that dictionary.
Worried that there still might be issues if the connection is
unreliable: if a response comes in twice it will error or
if a second offer is made without a response to the first
there will be an error.
Each blob requests has three parts
- A request to see what blobs are available
- A request to download and pay for one of those blobs
- A request to negotiate data costs
Before the refactoring all of the code to accomplish this was mixed into
one class. They are now three seperate classes.
There is still a lot of room for improvement, but it is at least better than
it was.
Fixes an error if you don’t have a conf file set up, previously it
would fail because the AutoFetcher object doesn’t have a console object
until it’s called for the first time
Adds a daemon for lbrynet. Currently commands are limited the following:
download_name(name)
resolve_name(name)
get_downloads
stop
This allows other programs to easily interact with lbrynet, such as
LBRYURIHandler. LBRYURIHandler can be built with py2app, the resulting
plist file must be edited in the same way the committed plist file has
been edited. When built and installed to the /Applications folder
lbry:// domain names will download and open the corresponding file so
long as the daemon is running.