dlt.common.runtime.init
restore_run_context
def restore_run_context(
run_context: RunContextBase,
worker_contexts: Optional[Dict[Type[ContainerInjectableContext],
ContainerInjectableContext]] = None
) -> None
Restores run context and worker-affinity contexts in a worker process.
Called by process pool workers to restore the execution environment from the
main process. The run_context is used to create a new PluggableRunContext,
while worker_contexts are contexts marked with worker_affinity=True that
are placed directly into the container.
Arguments:
run_context- The RunContextBase from the main process. Must haveruntime_configattached.worker_contexts- Dict mapping context types to instances, collected viaContainer.get_worker_contexts(). Each context is placed into the worker's container under its type key.