阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js N-API napi_add_env_cleanup_hook

      Node.js N-API napi_add_env_cleanup_hook

      新增于: v10.2.0 N-API version: 3

      NODE_EXTERN napi_status napi_add_env_cleanup_hook(napi_env env,
          void (*fun)(void* arg),
          void* arg);
      

      Registers fun as a function to be run with the arg parameter once the current Node.js environment exits.

      A function can safely be specified multiple times with different arg values. In that case, it will be called multiple times as well. Providing the same fun and arg values multiple times is not allowed and will lead the process to abort.

      The hooks will be called in reverse order, i.e. the most recently added one will be called first.

      Removing this hook can be done by using napi_remove_env_cleanup_hook. Typically, that happens when the resource for which this hook was added is being torn down anyway.


      更多内容请参考:Node.js N-API,或者通过 点击对应菜单 进行查看;


      目录
      本文目录
      目录