#31 - Creating thread with callback, on pre_load(). /JL

This commit is contained in:
2025-03-28 17:26:58 +01:00
parent 1be429c5cd
commit 406c1b77ed
4 changed files with 16 additions and 15 deletions
+4 -5
View File
@@ -1,4 +1,5 @@
import threading
import time
from xtendr.xtendrbase import XtendRBase
class ExamplePlugin(XtendRBase):
@@ -14,9 +15,6 @@ class ExamplePlugin(XtendRBase):
>>> plugin.stop()
ExamplePlugin has stopped!
"""
self.pre_load_done = threading.Event()
self.use_pre_load:bool = False #Indicate that pre-loading isn't neccessary
def run(self, *args, **kwargs):
arglen = len(args)
keylen = len(kwargs)
@@ -36,5 +34,6 @@ class ExamplePlugin(XtendRBase):
def stop(self):
print("ExamplePlugin has stopped!")
def pre_load(self):
pass
def pre_load(self, callback):
time.sleep(5) # Indicate long running pre-load.
callback()