v8.startupSnapshot.addDeserializeCallback(callback[, data])


  • callback <Function> 快照反序列化后调用的回调。
  • data <any> 调用时将传给 callback 的可选数据。

添加从快照反序列化 Node.js 实例时将调用的回调。 callbackdata(如果提供)将被序列化到快照中,它们可用于重新初始化应用程序的状态,或者在应用程序从快照重新启动时重新获取应用程序所需的资源。

  • callback <Function> Callback to be invoked after the snapshot is deserialized.
  • data <any> Optional data that will be passed to the callback when it gets called.

Add a callback that will be called when the Node.js instance is deserialized from a snapshot. The callback and the data (if provided) will be serialized into the snapshot, they can be used to re-initialize the state of the application or to re-acquire resources that the application needs when the application is restarted from the snapshot.