hide the implementation of exitting the worker loop