widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.65k stars 114 forks source link

[question] live updates/websocket #520

Open swelborn opened 3 months ago

swelborn commented 3 months ago

Hello. I would like to know if it is possible to trigger updates to the frontend through websockets with solara.

Something like this, for example: https://github.com/OpenChemistry/distiller/blob/main/frontend/distiller/src/features/notifications/index.ts#L76

maartenbreddels commented 3 months ago

Hi,

does https://solara.dev/examples/general/live_update help you? Solara already has a websocket connection, so no need to create another one. Note that instead of use_thread you can also now use https://solara.dev/api/use_task or https://solara.dev/api/task

Regards,

Maarten