-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WorkAsync method supporting parallel calls #505
Comments
This sounds very similar to #235. Do you have a plugin that has this issue currently I could test with? |
I think I see it. There is a single _worker object for the pluginControlBase class. It is not thread safe. But even worse, it only has a single _infoPanel that get's stepped on each time WorkAsync is called. So you call PluginControlBase.WorkAsync() twice in a row, and two panels get created, but when either the first task or second task is completed, it actually closes the second panel, and leaves the first open. I think the solution is to create a new worker every single time WorkAsync is called, and update SetWorkingMessage to update the most recently created worker. |
PR Submitted! |
Thanks!!
|
Tried it from my end - initial tests are very positive! 👍 |
I was able to edit a local plugin to to throw 3 WorkAsync Calls, each taking a second, and it worked just fine. |
Fix for WorkAsync method supporting parallel calls #505
I guess this has been fixed in November release |
October release! :) |
Yes, my mistake |
Being able to perform long-running tasks using async behavior introduced by
WorkAsync
method andWorkAsyncInfo
class is great.But launching several tasks simultaneously causes the yellow info panel to stay on top of the window, even after the last task has completed.
Trying to chain async calls by starting a new task at the end of a
PostWorkCallBack
method gives the same effect with the info panel.I hope this could be solved some way to really make use of the possibility to execute tasks async / in the background.
Of course, when simultaneous tasks are running, it might not be obvious which tasks message should be shown in the info panel, but perhaps just showing the last started one is enough.
Note: Except for the problem with the info panel, running async tasks in parallel works just fine using the
WorkAsync
method!Perhaps @shytikov or @daryllabar might be able to do something with this? Pretty please? :)
The text was updated successfully, but these errors were encountered: