[Extension development] Communication between extension bits

Hello,
I have started to draft an extension providing bookmarks (tracklist + current track/current time), and I have some interrogations about the way I found to make things work.

The ground requirements I am assuming are

  • a mopidy.core.Corelistener, watching for playback events and tracklist modifications
  • a websocket server, to provide clients with dynamic feedback about current bookmark state

The thing is those two extensions (bundled together) need to talk together. The most simple way to do this is just to have a singleton instance (of bookmark.Core class) that instances of both kind of extensions can have a reference to (you can see draft code at __init__.py and bookmarks.py ).

I’d be glad to have some feedback about this architecture (e.g is there some issue I should be aware of, is there a simpler/cleaner way to do this, etc). I also have bookmarks.Core inherit from pykka.ThreadingActor, although I have no idea whether it is necessary or not.