This method should be used by the application to block until work is finished
It will block until the timeout and interrupt the worker if not finished in time
It does not guarentee the timeout period because it will depend on how long it takes
the worker to finish after being told to stop.