Attempting threading for long-runing system processes
This commit is contained in:
19
mopidy_iris/system.py
Executable file
19
mopidy_iris/system.py
Executable file
@ -0,0 +1,19 @@
|
||||
|
||||
import logging, pykka, subprocess, os
|
||||
|
||||
# import logger
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class IrisSystemActor(pykka.ThreadingActor):
|
||||
|
||||
def __init__(self):
|
||||
super(IrisSystemActor, self).__init__()
|
||||
|
||||
##
|
||||
# Someone is telling us to do something
|
||||
##
|
||||
def run(self, action):
|
||||
path = os.path.dirname(__file__)
|
||||
return subprocess.check_output(["sudo "+path+"/system.sh "+action], shell=True)
|
||||
|
||||
actor_ref = IrisSystemActor.start()
|
||||
Reference in New Issue
Block a user