Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables tree not updated by background code #203239

Closed
roblourens opened this issue Jan 23, 2024 · 1 comment
Closed

Variables tree not updated by background code #203239

roblourens opened this issue Jan 23, 2024 · 1 comment
Assignees

Comments

@roblourens
Copy link
Member

Testing #203058

import threading
import time

# This is the variable you want to edit
my_var = 0

# This is the function that will run in the background
def background_task():
    global my_var
    while True:
        time.sleep(1)  # Wait for 1 second
        my_var += 1   # Increment the variable

# Start the background thread
thread = threading.Thread(target=background_task)
thread.start()

I don't know how you want to handle this or even whether this is common but I remembered that this is possible.

If there was a Refresh button that might unstick a user who wants to do this kind of thing. But if this is really unusual you could ignore it.

@amunger
Copy link
Contributor

amunger commented Jan 23, 2024

the refresh button would also have to alter the provider's behavior to not use the cache for that execution count. So I think the workaround of executing any cell to increment the count is good enough unless people really push for it.

@amunger amunger closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2024
@aiday-mar aiday-mar added this to the December / January 2024 milestone Feb 6, 2024
@microsoft microsoft locked and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants