Wrapper for generators to transform them in coroutines.