You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Platform could need a service that can execute commands on receiving an event.
I think there should be a service that can take A structure defining the parameters and a pattern for one or more commands. These can be executed from within any bundle by sending an event with the missing information.
This should be best implemented by having one service for all commands
The text was updated successfully, but these errors were encountered:
I want to share some of my thoughts behind that idea:
I think this service should either allow configuring an event per command or the command that should be executed could be passed with a general execute event.
I think multiple events would be more elegant because it seems to express the intention better. I want to explain this with a little example:
Maybe you want to use espeak as a tts system. Le's assume for a moment that there would be no nodejs library to use espeak even if there is one.
You could configure a speak-event so if a bundle wants to perform tts it would simply send "speak" and an object that contains the text. So if you name your commands in a sensible way, chances are that bundles you install will work out of the box if they communicate via events.
I know that there are no common best practices or guidelines on which types of services should use what communication mechanism, but I think events would be a sensible solution for tasks that do not really need to return data to the caller.
I also want to list a second example, where using a service instead of executing the command directly could come in handy:
Imagine that you wrote a beautiful Python script or a c++ program that does someone on its own and does not need external parameters to do its thing. If your script or program is not stable and you change things, maybe the path of your script changes or you suddenly need a parameter.
In that case, you would search all code for your command and change it in every place. At least in my head, that sounds like a lot of work that could be avoided if you would have a central place to store your commands.
Description
This Platform could need a service that can execute commands on receiving an event.
I think there should be a service that can take A structure defining the parameters and a pattern for one or more commands. These can be executed from within any bundle by sending an event with the missing information.
This should be best implemented by having one service for all commands
The text was updated successfully, but these errors were encountered: