Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to execute async functions in Node 8+ #94

Closed
jeffhollan opened this issue Jun 13, 2018 · 13 comments
Closed

Document how to execute async functions in Node 8+ #94

jeffhollan opened this issue Jun 13, 2018 · 13 comments
Assignees

Comments

@jeffhollan
Copy link

You can execute async functions in Node 8 today, but means you need to:

  1. Add the async () keyword before the method parameters
  2. Don't use the context.done() method (I assume) as it throws an error and appears to work fine without it.

@asavaritayal to help assign this. I'm happy to help or own this but wanted to make sure we were tracking somewhere. Feel free to move to right spot

@jeffhollan
Copy link
Author

@ColbyTresness as well - not sure who is managing the Node tasks 😃

@mhoeger
Copy link
Contributor

mhoeger commented Jun 13, 2018

@jeffhollan - thanks!! a small note, i think it would be better to leave out mention of node version in the verbage. we added node 10 support (not yet released though) and we're moving towards deprecating node 8 in favor of 10. update: support for Active LTS and Current versions

@mhoeger
Copy link
Contributor

mhoeger commented Jun 13, 2018

Related to Azure/Azure-Functions#431

@paulbatum
Copy link
Member

@jeffhollan @ColbyTresness should we turn this into a task to update the v2 templates to use async? If so we could move this issue to the templates repo. Would be nice as it would naturally demonstrate to users that they can use async and help cases where users forget to call context.done().

@jeffhollan
Copy link
Author

Yes I have started using by default and haven't seen any bad side-effects. I think it makes sense to move to the templates repo as a v2 must have

@jeffhollan
Copy link
Author

Opened a PR

@mhoeger
Copy link
Contributor

mhoeger commented Aug 8, 2018

@jeffhollan opened a PR in the docs repo too to update about context.done with async functions.

@paulbatum
Copy link
Member

@jeffhollan @ColbyTresness @mhoeger can we close this?

@jeffhollan
Copy link
Author

I'm cool with it and know @ColbyTresness has been working with @mhoeger on docs so likely this is covered. I'll let them

@ColbyTresness
Copy link

Lets leave it for a bit longer (1 week max) since this is something we've touched but haven't done a final pass through yet. I'll close this when that happens.

@fabiocav fabiocav added this to the Functions Sprint 32 milestone Sep 5, 2018
@mhoeger
Copy link
Contributor

mhoeger commented Sep 16, 2018

@ColbyTresness - how is this? or does async deserve its own bucket?

@ColbyTresness
Copy link

@mhoeger Sorry about the delay. I think what we have is a good start, but it doesn't seem sufficient: the only place we mention async in our JavaScript developer guide is in the context.done() section, which doesn't 100% make sense since using async means they don't need context.done(), and hence wouldn't look there. Upon further examination, I think this is important enough information to add as a paragraph in the intro section of the JS Dev guide. Thoughts?

@mhoeger mhoeger closed this as completed Oct 10, 2018
@paulbatum
Copy link
Member

Just for anyone that finds this issue and is looking for the updated docs, they are here:
https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node#exporting-an-async-function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants