React to a UI element inside `@ui.in_background`
When I put a UI element via
@ui.in_backgroundin the background, how can I react to the result in my normal (foreground) flow?
Say I have
dialogs.list_dialogand I want to do something with the result of the list in my
mainfunction. Can I somehow wait for the result ?
@halloleooo, you can use the queue module.
If both the main and background code see the same
my_queue = queue.Queue()(can be global, or passed as a parameter to the bg function), then your bg code can call
my_queue.put(value)and your main code can wait for it with
value = my_queue.get().
Much appreciated your tip. I will try this. :-)
(Very strange though that I didn't not get any email notification about your reply... Does this forum not send emails out???)
@halloleooo, unfortunately, all email notifications, including password resets, have been broken for about a year now.
@mikael Good to know. Thanks!