ocpapi.workflows.context

ocpapi.workflows.context#

Copyright (c) Meta Platforms, Inc. and affiliates.

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Functions#

set_context_var(→ Generator[None, None, None])

Sets the input convext variable to the input value and yields control

Module Contents#

ocpapi.workflows.context.set_context_var(context_var: contextvars.ContextVar, value: Any) Generator[None, None, None]#

Sets the input convext variable to the input value and yields control back to the caller. When control returns to this function, the context variable is reset to its original value.

Parameters:
  • context_var – The context variable to set.

  • value – The value to assign to the variable.