Set the current ``_context`` context variable. :type ctx: ClientContext :param ctx: Client context object to set as the current context variable. :rtype: contextvars.Token :returns: Token object used to revert the context variable to what it was before the corresponding set
(ctx)
| 45 | |
| 46 | |
| 47 | def set_context(ctx): |
| 48 | """Set the current ``_context`` context variable. |
| 49 | |
| 50 | :type ctx: ClientContext |
| 51 | :param ctx: Client context object to set as the current context variable. |
| 52 | |
| 53 | :rtype: contextvars.Token |
| 54 | :returns: Token object used to revert the context variable to what it was |
| 55 | before the corresponding set. |
| 56 | """ |
| 57 | token = _context.set(ctx) |
| 58 | return token |
| 59 | |
| 60 | |
| 61 | def reset_context(token): |
no outgoing calls