Hello,
can anybody please provide some information about the new lazy write method? I've not yet found anything. What's the meaning of the additional parameter (true, immediate) in saveObject?
lazy write
lazy write
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/17367041 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/17367041 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Re: lazy write
saveObject = function(name, object, immediate)
immediate can be:
0 or true to write right now
>0 to defer it to N seconds
undefined (missing) to use the default defer time of 5 minutes
immediate can be:
0 or true to write right now
>0 to defer it to N seconds
undefined (missing) to use the default defer time of 5 minutes
Re: lazy write
That means, another application can read this data not before the defer time is over?
Is the file stored with the same Linux process as the module instance or with a different process?
Is the file stored with the same Linux process as the module instance or with a different process?
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/17367041 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/17367041 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Re: lazy write
Correct. The data is not written to the filesystem before the defer time. This reduces write cycles and improved the SD card performance.
Of course the same pricess is doing save the data to the filesystem, just a bit later.
Of course the same pricess is doing save the data to the filesystem, just a bit later.
Re: lazy write
I'm sorry to be so insistent. But you will know that I'm using saveObject in my MxChartJS module. And of course I want to do that as little stressing as possible.
This sentence I haven't understood. Why does it reduce the write cycles, if you only do a break before execution? This doesn't combine the various write accesses?This reduces write cycles and improved the SD card performance.
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/17367041 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/17367041 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Re: lazy write
We are keeping the object in memory instead of writing to the SD. After 5 minutes we will save it to the memory. So all intermediate saveObject will be skipped.