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

Notifications within async callback throws an error #5920

Closed
mayonnaisecolouredbenz7 opened this issue Nov 25, 2023 · 0 comments · Fixed by #5924
Closed

Notifications within async callback throws an error #5920

mayonnaisecolouredbenz7 opened this issue Nov 25, 2023 · 0 comments · Fixed by #5924
Milestone

Comments

@mayonnaisecolouredbenz7
Copy link
Contributor

panel == 1.3.2

Trying to create and destroy a notification within async function throws an error described below. Equivalent code in synchronous function works as expected. Error looks to be when calling destroy()

import panel as pn
import asyncio
pn.extension('notifications')

async def btn_fun(event):
    notify = pn.state.notifications.send(
                "Running Stuff...",
                icon='<i class="fas fa-calculator fa-spin"></i>',
                duration=0,
            )

    await asyncio.sleep(2)
    notify.destroy()
button = pn.widgets.Button(name='Click me', button_type='primary',on_click=btn_fun)
button.show()

Stack traceback and/or browser JavaScript console output

RuntimeError: _pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes

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

Successfully merging a pull request may close this issue.

2 participants