Skip to content

Commit

Permalink
feat: task and use_task for better asyncio task a thread execution
Browse files Browse the repository at this point in the history
use_task can replace use_thread, but also support coroutine functions.

task is a decorator that creates a top level task that can be executed
from any location (e.g. a click handler of a button).
  • Loading branch information
maartenbreddels committed Feb 16, 2024
1 parent 5a6afaf commit f981cfd
Show file tree
Hide file tree
Showing 7 changed files with 1,410 additions and 1 deletion.
2 changes: 1 addition & 1 deletion solara/components/cross_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def update_filter():
v.Select(v_model=column, items=columns_numeric, on_v_model=set_column, label="Choose column")
v.Switch(v_model=invert, on_v_model=set_invert, label="Invert filter")
v.Switch(v_model=enable, on_v_model=set_enable, label="Enable filter")
with solara.ToggleButtonsSingle(value=mode, on_value=set_mode):
with solara.ToggleButtonsSingle(value=mode, on_value=set_mode): # type: ignore
solara.Button(icon_name="mdi-code-equal", icon=True, value="==")
solara.Button(icon_name="mdi-code-not-equal", icon=True, value="!=")
solara.Button(icon_name="mdi-code-less-than", icon=True, value="<")
Expand Down
1 change: 1 addition & 0 deletions solara/lab/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# isort: skip_file
from .components import * # noqa: F401, F403
from ..server.kernel_context import on_kernel_start # noqa: F401
from ..tasks import task, use_task, Task, TaskResult # noqa: F401, F403
from ..toestand import computed # noqa: F401


Expand Down
Loading

0 comments on commit f981cfd

Please sign in to comment.