Worker and the beachball

I’m doing more testing with Workers. But - man - the Workers aren’t much fun.

My code is rather simple. A folder is selected. Each subfolder is given to the worker to get a list of emlx files. For small folders the result is there really fast. But if I select the complete Mail folder I get a beachball in the built app and there is no result. I have some 100k files in the Mail folder so I know that searching the folder will take some time. But not all accounts have so many emails.

Bug or just bad design?

Waiting some seconds in the debugger gives a result:

Not finished, of course, but at least something.

I’ve seen the same kind of thing (also with custom helpers and IPC sockets, but this offers more control).

Basically, the helper sends too much to the main app, which has to handle a huge amount of data. I’m not sure whether the buffer is actually full at this state.
It would be nice if the Xojo worker and the main app could communicate better (e.g. the app tells the worker “I’m full, please wait”).

At least with the IPCSocket (and a separate, “traditional” worker app), the worker can check when the socket is full and pause for a moment. The Xojo’s worker lacks some functions for now.

App.DoEvents can be done in JobRun since it’s in the App.Run event (most likely) of the worker.


I’ll try that.