Terminate worker gracefully when rawdata is received