Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/function/handler_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export interface HandlerContext {
awsRequestId: string
logGroupName: string
logStreamName: string
/**
* A Promise that allows the function to respond immediately while still waiting
* for the operation to complete asynchronously.
*/
waitUntil: Promise<any>
Comment on lines +14 to +18
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is currently an incorrect type definition, as waitUntil is a method and not itself a Promise

I've made a suggested change below:

Suggested change
/**
* A Promise that allows the function to respond immediately while still waiting
* for the operation to complete asynchronously.
*/
waitUntil: Promise<any>
/**
* The waitUntil method enables the application to carry on executing after the response has been sent.
* The method has to be called at-least once synchronously before the response has beent sent, but after that it can be called multiple times, and will hold the keep the application running until all the promises passed to it have settled.
*/
waitUntil(f: Promise<any>): void;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently I have to pass a promise, rather than a function, to get this to work otherwise I get "i.catch is not a function"

identity?: { [key: string]: any }
clientContext?: { [key: string]: any }

Expand Down