libelektra
libelektra copied to clipboard
backend plugin
Building upon the implementation of elektraPluginCommit in #2798, I would like to reimplement the Backend structure as a plugin. That would bring the following benefits:
- Greater detachment from the core of
libelektra, asKDBwould only need to call the respective plugin functions, - Nesting plugins would be possible as backends could contain further backends.
Another problem I would like to solve with this implementation is that backends have a limited fixed amount of plugins that they can contain.
To solve this, I propose restructuring the plugin arrays (getplugins, setplugins and errorplugins) to arrays of linked lists. That way, plugins assigned to a specific role are added to the end of the list at the position corresponding to the role, with the possibility of a flexible number of further plugins being added to that role.
Due to complexity issues with operations such as file resolving and change recognition, the following roles will still only contain a single slot in their respective arrays:
getresolvergetstoragerollbacksetresolversetstoragecommit
Implementing backends as plugins has already been discussed in #973 and #1274.
Thank you for the summary!
@vLesk What is the current status?
As far as I can see, the implementation should be done (the ensurePluginUnmounted function in kdb.c is commented in though as we discussed a few months ago, additional work would need to be done for that to be supported), I'm still working on fixing the bugs. I've made changes to mount.c and further changes to the backend-related .cpp files. I'm currently working full time but I have some days off I can use, and in September I'll be working reduced hours so it should be easier to work out the rest of the bugs.
Thank you, it would be so great to get this finished. :sparkling_heart:
It is really one of the core features of Elektra and we constantly run into the too many plugin problem. The ensurePluginUnmounted is not a big deal, as discussed before. Maybe you can throw a not_implemented error there?
I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart: