Skip to content
Discussion options

You must be logged in to vote

You have several issue here.

The first one is that you use @state.change to handle a recursive call with progress. But like you notice, only once everything got stable (no more change) they got synched with the client.
The second one, if you want to dynamically update the client while you do things in the background without being busy, you need to use async tasks.

Here is an example on how you could do what you wanted

async def process_vrg_idx(vrg_idx):
   if not state.ready:
            return
   print(f"into change_vrg_idx, {vrg_idx=}")
   _ = view_point_pyvista[int(vrg_idx)]
   await asyncio.sleep(5)
   if vrg_idx < 5:
         asyncio.create_task(process_vrg_idx(vrg_idx+1)
         with 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@paulbauriegel
Comment options

Answer selected by paulbauriegel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants