refactor the coroutine implement

Signed-off-by: yayanyang <yayanyang@gmail.com>