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

Comments

Projects
None yet
5 participants
@jeffhollan
Copy link
Member

jeffhollan commented Jun 13, 2018

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

This comment has been minimized.

Copy link
Member Author

jeffhollan commented Jun 13, 2018

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

@mhoeger

This comment has been minimized.

Copy link
Collaborator

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

This comment has been minimized.

Copy link
Collaborator

mhoeger commented Jun 13, 2018

@paulbatum

This comment has been minimized.

Copy link
Member

paulbatum commented Aug 8, 2018

@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

This comment has been minimized.

Copy link
Member Author

jeffhollan commented Aug 8, 2018

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

This comment has been minimized.

Copy link
Member Author

jeffhollan commented Aug 8, 2018

Opened a PR

@mhoeger

This comment has been minimized.

Copy link
Collaborator

mhoeger commented Aug 8, 2018

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

@paulbatum

This comment has been minimized.

Copy link
Member

paulbatum commented Sep 5, 2018

@jeffhollan @ColbyTresness @mhoeger can we close this?

@jeffhollan

This comment has been minimized.

Copy link
Member Author

jeffhollan commented Sep 5, 2018

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

This comment has been minimized.

Copy link

ColbyTresness commented Sep 5, 2018

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

This comment has been minimized.

Copy link
Collaborator

mhoeger commented Sep 16, 2018

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

@ColbyTresness

This comment has been minimized.

Copy link

ColbyTresness commented Oct 3, 2018

@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 Oct 10, 2018

@paulbatum

This comment has been minimized.

Copy link
Member

paulbatum commented Jan 31, 2019

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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.