Refactor parts of the periodic worker
Perform some adjustments to the periodic worker type to make it easier to later change and make it better in the future. These changes hopefully also reduce complexity and increase understandability. In part this deprecates providing a tombstone via __init__() since that will restrict future enhancements we can make (in retrospect we need more internal control over that argument & type to build better workers). Change-Id: I1965e157c303c2a45b9950e9f4a921c638f57fd1
This commit is contained in:
@@ -101,6 +101,12 @@ def countdown_iter(start_at, decr=1):
|
||||
start_at -= decr
|
||||
|
||||
|
||||
def reverse_enumerate(items):
|
||||
"""Like reversed(enumerate(items)) but with less copying/cloning..."""
|
||||
for i in countdown_iter(len(items)):
|
||||
yield i - 1, items[i - 1]
|
||||
|
||||
|
||||
def merge_uri(uri, conf):
|
||||
"""Merges a parsed uri into the given configuration dictionary.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user