Closed iakkus closed 3 years ago
Another purpose of this PR is to also prepare the codebase for the future modularization of the objects, such that user code can instantiate (e.g., using a library) desired objects for accessing the datalayer, manipulating dynamic workflows or session utils.
Afaics no functional change here except maybe the removal of publishing to the recovery manager.
Yes, no functional change. Publishing to the recovery manager was actually a no-op (i.e., the responsible function was returning immediately).
A WorkerParams class might be useful, but I don't see, as of right now, much of a difference from the generic dict object, which also works as a map. If in the future there are other capabilities this separate class would give us, we can add it.
This PR simplifies the object creation by passing the worker parameters, such that the object attributes can be created using a single dictionary. Previously, there were many parameters being passed to each object, such that maintainability and readibility were decreased.
Furthermore, this PR makes simple refactoring changes to the way api objects are created after the fork in FunctionWorker and unifies the way they are created. Previously, state_utils was created in the parent function worker whereas publication_utils, session_utils and sapi were created after the fork. With this PR, they are all created in the parent FunctionWorker; however, they are updated as necessary after the fork (e.g., setting the corresponding key or session_id).
There are also minor tweaks to some tests.