Skip to content

Commit

Permalink
Unpack partials
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed May 23, 2022
1 parent dc8a988 commit 3357f49
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion panel/io/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import asyncio
import datetime as dt
import functools
import inspect
import json
import logging
Expand Down Expand Up @@ -446,7 +447,10 @@ def execute(self, callback: Callable([], None)) -> None:
callback: callable
Callback to execute
"""
if param.parameterized.iscoroutinefunction(callback):
cb = callback
while isinstance(cb, functools.partial):
cb = cb.func
if param.parameterized.iscoroutinefunction(cb):
param.parameterized.async_executor(callback)
elif self.curdoc:
self.curdoc.add_next_tick_callback(callback)
Expand Down

0 comments on commit 3357f49

Please sign in to comment.