Skip to main content
Version: devel

dlt.common.runtime.init

restore_run_context

def restore_run_context(
run_context: RunContextBase,
worker_contexts: Optional[Dict[Type[ContainerInjectableContext],
ContainerInjectableContext]] = None
) -> None

View source on GitHub

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 have runtime_config attached.
  • worker_contexts - Dict mapping context types to instances, collected via Container.get_worker_contexts(). Each context is placed into the worker's container under its type key.

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.