freeze_writesfreeze_writes — controls when writes are sent to the DataHub engine.
freeze_writes (t|nil)t|nilCalling this function with a true value (t) collects all subsequent datahub_write calls in an internal
buffer. A nil value sends the accumulated
calls to the DataHub engine in a single call, and re-enables normal
datahub_write calls.
t on
success, otherwise an error message.
When writing large numbers of points to the DataHub engine the thread context switch adds significant delay. Using this function allows write requests to accumulate in an internal buffer and get sent all at one time. Use like this:
Call freeze_writes(t).
Call datahub_write multiple times as needed
(within reason).
Call freeze_writes(nil). This will execute all
the preceding writes in a single call
See also
datahub_write.