worker routines for MIF and prediction + wait for worker to be connected