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

panel.io.hold not working in threaded app #7590

Open
TheoMathurin opened this issue Jan 6, 2025 · 0 comments
Open

panel.io.hold not working in threaded app #7590

TheoMathurin opened this issue Jan 6, 2025 · 0 comments

Comments

@TheoMathurin
Copy link
Contributor

Software Version Info
panel 1.5.5
bokeh 3.6.2

When automatic threading is enabled, using hold does not work and an error appears in the logs.

In foo.py:

import panel as pn
from panel.io import hold

@hold()
def increment(e):
    for obj in column_1:
        obj.object = str(e.new)

column_1 = pn.FlexBox(*['0']*100)
button = pn.widgets.Button(name='Increment', on_click=increment)

pn.Column(column_1, button).servable()

and

panel serve foo.py --num-threads 4

Stack traceback and/or browser JavaScript console output

ERROR: panel.io.document - Using the unlocked decorator when running inside a thread is not safe! Ensure you check that pn.state._current_thread matches the current thread id.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant