mycroft-coreprocesses and the Skills, and can also be joined by outside systems such as the CLI.
mycroft-core. The producers and consumers listed are examples and some messages might be generated or handled by other processes or advanced Skills.
mycroft.stopmessage is caught by the skill framework, invoking an overridden
MycroftSkills.stop()method within a Skill. Similarly, the
speakmessages to be conveyed to the text-to-speech (TTS) and audio systems.
MycroftSkill.add_event()method allows you to attach a handler which will be triggered when the message is seen on the Messagebus.
MycroftBusClient()object can be setup to connect to any host and port as well as any endpoint on that host. this makes it quite versatile and will work on the main bus as well as on a gui bus. If no arguments are provided it will try to connect to a local instance of Mycroft-core on the default endpoint and port.
Messageobject is a representation of the messagebus message, this will always contain a message type but can also contain data and context. Data is usually real information while the context typically contain information on where the message originated or who the intended recipient is.
speakMessage with a data payload. Mycroft would consume this Message and speak "Hello World".
print_utterancethat prints the
utterancefrom a Message. This is registered as a handler for the
speakMessage. Finally we call the
run_forever()method to keep the
speakMessage we emitted and print:
Mycroft said "Hello World"