mirror of
https://github.com/LBRYFoundation/lbry-sdk.git
synced 2025-08-23 17:27:25 +00:00
adding reactor.callLater as a utils function
This commit is contained in:
parent
7e2fad2397
commit
30c7559d3a
2 changed files with 8 additions and 0 deletions
|
@ -12,6 +12,7 @@ at anytime.
|
||||||
\#\# [0.8.6rc0] - 2017-02-19
|
\#\# [0.8.6rc0] - 2017-02-19
|
||||||
### Changed
|
### Changed
|
||||||
* Add `file_get` by stream hash
|
* Add `file_get` by stream hash
|
||||||
|
* Add utils.call_later to replace reactor.callLater
|
||||||
###
|
###
|
||||||
* Fix unhandled error in `get`
|
* Fix unhandled error in `get`
|
||||||
* Fix sd blob timeout handling in `get_availability`, return 0.0
|
* Fix sd blob timeout handling in `get_availability`, return 0.0
|
||||||
|
|
|
@ -45,6 +45,13 @@ def datetime_obj(*args, **kwargs):
|
||||||
return datetime.datetime(*args, **kwargs)
|
return datetime.datetime(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
def call_later(delay, func, *args, **kwargs):
|
||||||
|
# Import here to ensure that it gets called after installing a reator
|
||||||
|
# see: http://twistedmatrix.com/documents/current/core/howto/choosing-reactor.html
|
||||||
|
from twisted.internet import reactor
|
||||||
|
return reactor.callLater(delay, func, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def generate_id(num=None):
|
def generate_id(num=None):
|
||||||
h = get_lbry_hash_obj()
|
h = get_lbry_hash_obj()
|
||||||
if num is not None:
|
if num is not None:
|
||||||
|
|
Loading…
Add table
Reference in a new issue