farm: support graceful stop

It is not use thread!