Base Worker#
In this example, we show how to create a base worker that other workers can inherit from and customize.
Code#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Explanation#
To create a base worker class from which workers can be derived, define the base class object's configuration and use the replace method to copy it with different configurations. replace method was implemented by using dataclasses.replace method, to copy the dataclass with different parameters.