v8.startupSnapshot.addDeserializeCallback(callback[, data])
-
callback
<Function> 快照反序列化后调用的回调。¥
callback
<Function> Callback to be invoked after the snapshot is deserialized. -
data
<any> 调用时将传给callback
的可选数据。¥
data
<any> Optional data that will be passed to thecallback
when it gets called.
添加从快照反序列化 Node.js 实例时将调用的回调。callback
和 data
(如果提供)将被序列化到快照中,它们可用于重新初始化应用的状态,或者在应用从快照重新启动时重新获取应用所需的资源。
¥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.