-
Notifications
You must be signed in to change notification settings - Fork 0
Service framework #2
base: develop
Are you sure you want to change the base?
Conversation
…e is set to empty.
Hi Liam, There seems to have been a bit of a mixup with this PR. I was actually just yesterday visiting @jodal and talking our plans for the future of mopidy and I at least had this work in the back of my head. As such it had me wondering what ever became of the effort you started. Since this PR was opened against your repo and not the mopidy repo it seems we have simply lost it. I remember seeing some mails about four month ago where you closed the PR you had against us and I didn't have time to follow up on what became of all this. So no, we never meant to keep you waiting this long, but things completely fell of the table as this was opened against the wrong repo and none of us had time to try track down what happened :( |
Hi, Please advise what you'd like me to do to get this back on the table Cheers, On 6 January 2015 at 09:38, Thomas Adamcik [email protected] wrote:
|
Best first step would be to reopen this as PR against the main mopidy repo. Then we can take the rest from there. |
+1 Looks like this will be really useful. |
@adamcik @jodal - thanks for agreeing to review this framework for services. Please refer to mopidy/mopidy#778 for details/background and bear in mind the following points:
mopidy.service.Service
will be registered into a service registry which is maintained byCore
.Core
also provides acore.service.ServiceController
. Thecore.service.ServiceController
is the principal means by which remote configuration can be achieved via HTTP/JSON RPC.mopidy.service.Service
defines the required methods, which includes the ability to get and set properties dynamically. The underlying implementation is not exposed in the API so it doesn't matter if it's a file, dbus or whatever.name
string attribute defines a unique name for the service. It must be set during__init__()
of the service object. Any name clashes will be picked-up during the registration process.public
boolean attribute allows a service's API to be fully exported through HTTP JSON/RPC. This is handled automatically as part of the service registration process.public
isTrue
, then the classes' API calls are visible via HTTP/JSON RPC using themopidy.servicename.method(args)
calling convention.public
isFalse
then only the methods fromService
shall be callable through themopidy.service.method(service_name, args)
methods. In this case the service name is supplied toServiceController
to resolve.mopidy.service.ServiceListener
class provides a set of generic events to indicate when a service has started, is stopped or a property is changed. These are expected to be notified where appropriate in the underlying implementation of the service.mopidy.service.ServiceListener
and will be relayed through the websocket. I would suggest we adopt some event naming conventions to avoid confusion.You can find some example frontend services I have written here:
They all implement dynamic configuration property setting in a very simplistic manner which does not allow for persistent storage of values. This is the major missing part which I didn't wish to embark upon since it probably needs a bit more thought to make it backwardly compatible with the existing configuration mechanism.
@jodal I noticed you had written https://github.com/mopidy/mopidy-alsamixer extension recently. I think this would be a good candidate for trying to turn into a frontend service to get a feel for it.