doc: add documentation for AtExit hook#1014
doc: add documentation for AtExit hook#1014JCMais wants to merge 5 commits intonodejs:v1.xfrom JCMais:docs-addons-atexit
Conversation
doc/api/addons.markdown
Outdated
There was a problem hiding this comment.
The explanation here seems confusing, suggestions?
There was a problem hiding this comment.
"Callbacks are run in last-in, first-out order. AtExit takes two parameters: a pointer to a callback function to run at exit, and a pointer to untyped context data to be passed to that callback."
|
I'm generally +1 on this – we might see if it breaks the addons tests (which generate tests from code snippets in the addons.markdown doc.) |
doc/api/addons.markdown
Outdated
There was a problem hiding this comment.
Maybe AtExit(at_exit_cb1, exports->GetIsolate() and then static_cast<v8::Isolate*>(arg) in the callback? v8::Isolate::GetCurrent() is going away someday so I'd prefer not to encourage its use in the documentation.
(That said, I realize it's used in plenty of other places in this document. I'll file a PR to clean that up.)
|
Ping @JCMais, are you able to update? |
Updates addons.markdown to mention AtExit() function. Addresses issue #8324.
Updated description, added arguments and arguments types, and quick code example.
Incorporated latest suggestions.
|
@Fishrock123 Sorry, totally forgot about this pull request. Updated. |
|
ping @bnoordhuis for review? |
|
Landed in 98649fd with some fixes to make |
Fixes: nodejs/node#999 PR-URL: nodejs/node#1014 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
See #999.