Download User manual
Transcript
21. High-level API Reference voltage→load_async() YVoltage Preloads the voltage sensor cache with a specified validity duration (asynchronous version). js function load_async( msValidity, callback, context) nodejs function load_async( msValidity, callback, context) By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance. This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine. Parameters : msValidity an integer corresponding to the validity of the loaded function parameters, in milliseconds callback callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or YAPI_SUCCESS) context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. 224 www.yoctopuce.com