If you use a Worker in Xojo to run code on multiple cores, you basically get a helper console application to do the work. Workers are launched in Xojo as needed to process whatever jobs you provide. Since workers have no open or started event, you can't easily put the registration code there (see feedback case 62409). But you can use static keyword to get a globally stored, but locally defined boolean to check status:
As you see we can check registered flag to only register the first time. All first time work like initialization of plugin, opening a database connection or similar can be done there.
To have code cleanup when the helper quits you can put in a property referencing a class and put cleanup in destructor there. e.g. you can have a tempFile class, with a property for the FolderItem and delete the file in the destructor.