socon
socon copied to clipboard
Add a way to register function in a Manager
It would be interesting that the manager does not register only class but also function. That way we can look for function in specific case instead of having to create a class in a single method.
The way I would do it is to implement a class decorator in the Manager. Something like:
@classmethod
def register_func(cls, func: callable):
...
So we can call it with any Manager on a function like:
@Manager.register_func
def myfunc(...):
pass
The decorator must take into account in which config we are and save it in the registry.