Skip to content

Commit fd1bc8f

Browse files
committed
Require latest shiny; use the new run_coro_hybrid() to send custom messages syncronously
1 parent 1ae01ba commit fd1bc8f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ipyshiny/_comm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from typing import Callable, Dict, Optional, List
33

44
from shiny import get_current_session
5-
from shiny._utils import run_coro_sync
5+
from shiny._utils import run_coro_hybrid
66

77
from ._serialization import json_packer
88

@@ -166,7 +166,7 @@ def _publish_msg(
166166
# In theory, it seems that this send could maybe be async (that we then asyncio.create_task() with),
167167
# but that might mean that messages are sent out of order, which is not what we want.
168168
def _send():
169-
run_coro_sync(session.send_custom_message(msg_type, msg_txt)) # type: ignore
169+
run_coro_hybrid(session.send_custom_message(msg_type, msg_txt)) # type: ignore
170170

171171
# N.B., if we don't do this on flush, then if you initialize a widget
172172
# outside of a reactive context, run_coro_sync() will complain with

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ setup_requires =
3333
install_requires =
3434
ipywidgets>=7.6.5
3535
jupyter_core
36-
shiny>=0.2.0.9006
36+
shiny>=0.2.0.9007
3737
python-dateutil>=2.8.2
3838
tests_require =
3939
pytest>=3

0 commit comments

Comments
 (0)