Cloud 함수 개념: 함수 종료

노드의 함수 종료 표시

코드 샘플

Node.js

Cloud Functions에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.

// Await-ing promises within functions is OK if you don't return anything
await Promise.resolve();

// These will cause background tasks to stop executing immediately
return 1; // OK: returning a value

// These will wait until the related background task finishes
return Promise.resolve(); // OK: returning the promise itself
return await Promise.resolve(); // Same as above
return Promise.reject(); // OK: same behavior as to-be-resolved promises
return await Promise.reject(); // Same as above

다음 단계

다른 Google Cloud 제품의 코드 샘플을 검색하고 필터링하려면 Google Cloud 샘플 브라우저를 참조하세요.