[add feature] spawn can handle generator function now.