jina.executors.decorators module

Decorators and wrappers designed for wrapping BaseExecutor functions.

jina.executors.decorators.wrap_func(cls, func_lst, wrapper)[source]

Wrapping a class method only once, inherited but not overridden method will not be wrapped again

Parameters
  • cls – class

  • func_lst – function list to wrap

  • wrapper – the wrapper

jina.executors.decorators.store_init_kwargs(func)[source]

Mark the args and kwargs of __init__() later to be stored via save_config() in YAML :type func: Callable :param func: the function to decorate :rtype: Callable :return: the wrapped function

jina.executors.decorators.requests(func=None, *, on=None)[source]

@requests defines when a function will be invoked. It has a keyword on= to define the endpoint.

A class method decorated with plan @requests (without on=) is the default handler for all endpoints. That means, it is the fallback handler for endpoints that are not found.

Parameters
Returns

decorated function