@Alejandro_Alaco , did you find this method better or easier than what @pascal.fragnoud suggested in this post? What did you like more/less?
I ask because I am about to implement this and wanted to see if one method is preferred vs. another.
Frankly, I don't understand why you'd want to introduce an extra layer of messages and handlers. This requires extra setup, for no gain.
The general idea is the same: open a popup, process things, close popup.
The decorator handles this by opening and closing the popup for you, with a try/except/finally to make sure the popup is always closed, even if the code raises an error.
Bringing message into this only adds steps and complexity for which I can't find a justification.
The only thing it brings would be that you don't need to add a function in your script library...
But if that's really an issue, you can define that function in the event/transform and decorate it there. But frankly, if a function may take long enough to warrant a spinner, it probably deserves a spot in the library.
Actually, I guess this could be used to open the spinner on some event and close it on another event, but that sounds like a terrible idea. I really wouldn't do that. I'd rather decorate each event, which adds the possibility of displaying different loading messages for different steps of the process.