Migrate to amphp/thread