Skip to content

Feature request: Invocation context manager #2068

Open
@ran-isenberg

Description

@ran-isenberg

Use case

  1. I want to store global variables so they can be fetched in multiple areas in my areas without having to explicitly passing them around into the inner functions.
  2. I want these variables to get cleaned automatically on every invocation
  3. I want to have the option to automatically add these variables the logger so they are logged. But i want to also have the option not to do that. for example: log tenant id, but dont log the user's email address.
  4. I want to have a simple get function to get these parameters by name.
  5. I'd like to have some default function getters such as tenant id, username.

Solution/User Experience

A singleton class that has several functions:

  1. store value - store(key: str, value: Any, should_log : bool)
  2. get value - get(key)
  3. get_tenant_id
  4. get_username
  5. store_tenant_id(tenant_id : str)
  6. store_username(username: str)

Alternative solutions

No response

Acknowledgment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestfeature requestneed-customer-feedbackRequires more customers feedback before making or revisiting a decisionon-holdThis item is on-hold and will be revisited in the future

    Type

    No type

    Projects

    Status

    Ideas

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions