Skip to content

Commit

Permalink
Update launcher to handle audio service
Browse files Browse the repository at this point in the history
Update ovos-core dependency spec
  • Loading branch information
NeonDaniel committed Jun 14, 2022
1 parent eaac650 commit 66ad30c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 24 deletions.
60 changes: 37 additions & 23 deletions neon_core/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,40 +28,54 @@

from mycroft.lock import Lock
from mycroft.util import wait_for_exit_signal, reset_sigint_handler

from neon_audio.service import NeonPlaybackService
from neon_messagebus.service import NeonBusService
from neon_core.skills.service import NeonSkillService
from neon_gui.service import NeonGUIService
from neon_speech.service import NeonSpeechClient


reset_sigint_handler()
# Create PID file, prevent multiple instances of this service
# TODO should also detect old services Locks
lock = Lock("NeonCore")
def main():
reset_sigint_handler()
# Create PID file, prevent multiple instances of this service
# TODO should also detect old services Locks
lock = Lock("NeonCore")

# launch websocket listener
bus = NeonBusService(daemonic=True)
bus.start()
bus.started.wait(30)

# launch websocket listener
bus = NeonBusService(daemonic=True)
bus.start()
bus.started.wait(30)
# launch GUI websocket listener
gui = NeonGUIService(daemonic=True)
gui.start()

# launch GUI websocket listener
gui = NeonGUIService(daemonic=True)
gui.start()
# launch skills service
skills = NeonSkillService(daemonic=True)
skills.start()

# launch skills service
skills = NeonSkillService()
skills.start()
# launch speech service
speech = NeonSpeechClient(daemonic=True)
speech.start()

speech = NeonSpeechClient()
speech.start()
# launch audio playback service
audio = NeonPlaybackService(daemonic=True)
audio.start()

wait_for_exit_signal()
wait_for_exit_signal()

speech.shutdown()
skills.shutdown()
gui.shutdown()
bus.shutdown()
for service in (audio, speech, skills, gui, bus):
service.shutdown()
if service.is_alive():
print(f"{service} not shutdown")
try:
service.join()
except Exception as e:
print(e)
lock.delete()
print("Stopped!!")

# TODO: Add audio service when implemented DM

lock.delete()
if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# mycroft
ovos-core[skills_lgpl]~=0.0.3
ovos-core[skills_lgpl]~=0.0.4a19
# utils
neon-utils~=0.17,>=0.17.3
ovos_utils~=0.0.20
Expand Down

0 comments on commit 66ad30c

Please sign in to comment.