implements basic logic of worker_cb in server framework