Generating the client stub
Within DASF we provide the possibility to automatically generate the client stub from
the server stub (see Remote Procedure Calls if you want to know more about these
terms). This is done in the
generate()
method of the
BackendModule
class and can also be
invoked from the command line, e.g.
python ExampleMessageConsumer.py generate
The generation of these files work via so-called jinja2 templates[1].
Each config class, i.e.
FunctionConfig
,
ClassConfig
and
ModuleConfig
holds the reference to a
Template
. This template is used to render the
corresponding function, class or module in the client stub. You can find these
templates in the demessaging/templates
folder of the source code.
Note
currently we only support the automatic creation of python client stubs. But we aim for the support of typescript in the near future.