Concurrent js_api call question #899
Unanswered
RickSelden
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Is there an easy way I can stop concurrent js_api calls?
for example, if a user hits a button in a menu and it fires the corresponding python via js_api, but they cheekily press another button before the other js_api/python backend has finished executing so both backend functions run concurrently.
While I can see this would be quite cool and desirable in some situations- its a bit tricky for me because my different buttons are turning dishwasher / chemical dispenser relays on and off, on different timed programs.
I know I could lock off buttons in javascript to mitigate this, I was wondering if there's a way to do it directly with pywebview.
Also, I run into a similar problem when the user hits F5, the browser refreshes and it fires my init code but does not abort whatever js_api/python it was already in the middle of, so I get zombie behaviours from the previous backend thread(s) still running.
Does anyone know a good way to handle these kinds of scenario with pywebview? Some way of aborting previous backend calls when new ones arrive?
thanks,
Rick
Beta Was this translation helpful? Give feedback.
All reactions