Skip to content

Add a way to register function in a Manager #40

@StephaneCapponi

Description

@StephaneCapponi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions