[core/module] allow modules to perform updates in background

a module can now set `self.background = True` in its `__init__()` method
to make sure its update method is invoked in a separate thread.

also, do a PoC implementation of this for the github module.

TODO: add this to dev doc

see #640
This commit is contained in:
tobi-wan-kenobi 2020-05-30 17:20:41 +02:00
parent a13898cbae
commit 547874dafd
2 changed files with 19 additions and 1 deletions

View file

@ -34,6 +34,7 @@ class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.github))
self.background = True
self.__count = 0
self.__label = ""
self.__requests = requests.Session()