You could try passing a ptr of a delegate pointing to a method in a module, which takes Ptr or Integer parameters and then stores values in global properties.
Then you can have a timer check regularly if the properties got set, so you know the callback arrived.
The method in the module must have background tasks, nil object checking and stack checking disabled via #pragma.
That could work.