-
Notifications
You must be signed in to change notification settings - Fork 123
proposal: kdbEnsure #868
Comments
|
The current plan is that we create new APIs (similar to |
@kodebach Is this maybe a byproduct of the checks done within the high-level API? |
In #2383 we found that sometimes the absence of plugins might be required (e.g. for cmd-line options). So for now, we either want to say that a global plugin needs to be present (internalnotification or also cmd-line options) or should be absent (cmd-line options for maintenance tasks). |
Instead of creating The advantage of passing the information to
|
Yes, modifying kdbOpen is the long-term solution. Maybe we can even break the ABI soon and release 0.9. |
We could do something similar to |
Yes, we could add elektraKdbOpen in libproposal. But it is slowly getting messy. |
The contract can be very generic but mounting/unmounting of plugins can still be the only feature for now. I am not sure if only global plugins suffice, as some application developers might also consider non-global plugins essential for their application (e.g. profile)? And didn't we even say that the gopts plugin will be non-global? If we do not need non-global plugins for now, only mounting/unmounting of global plugins is enough. At least for non-global plugins (but maybe also global plugins?) we should ask ourselves the question if we really want to mount/unmount plugins or is it better to let the application fail if the mounting is done wrongly. (The plugin config kdbEnsure delives might be unwanted.)
Imho the interface for the notification library is quite nice. Do you see here any room for improvement?
Having good cohesion is nice, independent of the feature set we implement. |
It turns out a global plugin makes the interaction easier, even if the plugin doesn't need to know about the whole KDB. Global plugins always receive the parent key given to
Because of the
My idea was either to fail, if the given mounted requirements are not fulfilled, or to require a full configuration to be given when a plugin is required to be mounted. The idea basically being either the user mounts the plugin themselves with their own configuration, or the default from inside the application is used. Unmounting/disabling a plugin should always work
The interface is definitely nice, but in principle what the library does, is basically the intended use case for |
And also to enable for applications that rely on cmd-line options.
Yes, sounds very good.
Yes, the you are right. With KEY_FUNC passing the pointer to the main-loop might be not so bad after all. I hope this change will not be a Pandora's box.
Really? In a file included by users? That really should not happen 😢 |
There is definitely a trade-off between having strongly typed functions and function pointer and using a generic KeySet. We might want to leave the library for notifications (they are quite a special case) and just invoke Maybe this could even be the solution in general.
It is only included in the C file, so users won't notice it. It still requires that the version of libnotification and elektra-core and elektra-kdb are compatible though. |
The implementation in #2471 right now supports mounting/unmounting global plugins, as well as unmounting non-global plugins (mounting them is quite a bit more complicated). I am thinking about allowing to add a new mountpoint with only a storage plugin More functionality shouldn't be added at the moment IMO, because the plugin framework is going to change. I also noticed that in some sense a fully functional |
Yes, the tools library should be rewritten in C (or Rust) but actually I would like to avoid to have it pulled into kdb itself. |
Wouldn't Rust cause the same problems as C++? i.e. requiring Rust standard libraries on any system using it (unless you use Rust's |
Maybe, I did not yet compare the size of the run-time libs of C++/Rust. |
IMO it is not just about size but also about availability. Rust does support a lot of systems, but C certainly supports more. It would be very weird to have a library like |
Yes, of course. it will be a long way for any language to be as widely available as C.
I was talking about rewriting libtools. I agree: Only for kdbEnsure it would be strange. |
As discussed we need for some applications a way to ensure that some global plugin are present. For example, e.g. applications that need the cachefilter (written by @Namoshek) or need the internalnotification ( #828 written by @waht).
More generally put, some Applications need behaviour from Elektra that was not there some versions ago and cannot be the new default.
In the long term, we should extend
kdbOpen
so that users can request any functionality (either by plugins or the core itself).In the shorter term, we could add a
kdbEnsure
that will add a global plugin if it was not there before, exactly fulfilling the current needs.A possible API would be:
The text was updated successfully, but these errors were encountered: