Skip to content

Draft: Initial implementation of busses

Kyle Sunden requested to merge busses into main

Okay, still a little bit rough, but generally works.

Things left to do:

  • refactor to reduce copy pasted code
  • use the config file itself as source of the daemon kind (currently uses directory path as that was easier prior to refactoring) [this is why the test is failing, wrote the test to pass upon this change being implemented]
  • Decide if a singular yaqd-bus-python is what we actually want... we had been leaning towards an ABC and more targeted entry points. but in implementing it I simply do not see why we would need those/what purpose such concrete children would serve other than to confuse.
  • Fill out the YEP with details of actual implementation (most of it is actually correct, if perhaps a bit vague)
  • enable buses in yaqd-control (shouldn't be too hard, especially if we leave them out of --all, otherwise just adding some info to the cache, changing the entrypoint)
  • Update changelog (waiting until we have discussed the particulars)
  • Write some other docs page? maybe a post to python.yaq.fyi?

Also... do we want to have a "uses-bus" trait? should that be required to opt in to the behavior? it would be a pure config trait, and would technically apply perfectly fine to all currently implemented daemons (though some will need an update to handle shared resources which may currently be tracked at the daemon class level, requiring a separate shared class to mediate)

I was going to make a test which provided a method to see the PID of the daemon running in the bus process, but the lookup scheme from the daemon kind requires the entry point to exist.

This MR does introduce a minimal dependency, entrypoints, which is a handy library for interrogating entry points that is a single small python file by the same dev behind flit. Similar entrypoint inspection is also provided by setuptools, but that is a much heavier dep that we don't need otherwise. (there is the stdlib importlib.metadata, but that is marked as provisional interface which may change, and doesn't provide dicts, so have to search through sequences)

Edited by Kyle Sunden

Merge request reports