Skip to content

Commit 5e60075

Browse files
authored
Merge pull request #48556 from mhoeger/patch-5
Update context.done section with async functions
2 parents 839c772 + e2e7cd7 commit 5e60075

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

articles/azure-functions/functions-reference-node.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ context.bindings.myOutput = {
9090
context.done([err],[propertyBag])
9191
```
9292

93-
Informs the runtime that your code has finished. You must call `context.done`, or else the runtime never knows that your function is complete, and the execution will time out.
93+
Informs the runtime that your code has finished. If your function uses the `async function` declaration (available using Node 8+ in Functions version 2.x), you do not need to use `context.done()`. The `context.done` callback is implicitly called.
94+
95+
If your function is not an async function, **you must call `context.done`** to inform the runtime that your function is complete. The execution will time out if it is missing.
9496

9597
The `context.done` method allows you to pass back both a user-defined error to the runtime and a property bag of properties that overwrite the properties on the `context.bindings` object.
9698

0 commit comments

Comments
 (0)