design of Busy Plugin

I’m was rethinking the process of blocking the UI in our solution.

We simply like to block the UI while some method is being executed (without cancellation possibility). This is possible with the Busy Plugin, but I have some questions regarding the design of this plugin:

The Busy Plugin uses a ‘processFunction’ parameter in order to start the (lengthy) method. But this means that for every method that needs a UI block, we should create a second method holding the Busy Plugin call with the appropriate processFunction parameter. I don’t feel that this is an ideal way of implementing UI blocking. I’d rather have some simple .block() and .release() calls which I can put in the methods that need UI blocking. In that way we wouldn’t need extra methods as needed with the Busy Plugin. But, am I overseeing some clear reason(s) why the Busy Plugin is built in this specific way? Or, should I jump into the world of custom plugins, and create a UI blocking method that works the other way around (block UI when needed in lengthy method, instead of calling the method that needs to be blocked)?

And you can’t send parameter to the processFunction…

@Kaptan: yes, I think you are overlooking the fact that the plugin being also Web client, it has to take the Web Client limitations into account…
Truly, the first version of the plugin was done the way you’d like it to work now, but then it ceased to work with Servoy 5+ in web client. so it was refactored to adapt to that problem.
The reason being that once you have blocked the UI, you cannot send a request to launch a method (which happens on the server side), so the design is made to overcome this: you ask the plugin to block AND launch the process in ONE call.
Basically you should understand that there is only one communication channel at a time between the web client (in the browser) and the methods that execute on the server.
If you block it with a call that takes time to complete, then every call you make will happen AFTER the first method called has completed.
Now it is possible to have a Smart client only plugin which would work the way you want but this one was made for Smart and Web, thus designed this way.
Hope this clarifies.

@log-out: It would be possible to add parameters to the processFunction. Please open a case on the ServoyForge project for this.

Patrick, I see that in v2.1.4 you can send parameteres to the processFunction, thanks!

@Patrick: I see, thank you for the clarification! In the mean time we’ve created a custom plugin for smart client only that works the other way around.