[...]
Here is the the first thing I am seriously stumbling over:
static void db_queue_event_log (evSubscrip *pevent, db_field_log *pLog)
{
...
/*
* if we have an event on the queue and both the last
* event on the queue and the current event are emtpy
* (i.e. of type dbfl_type_rec), simply ignore duplicate
* events (saving empty events serves no purpose)
*/
if (pevent->npend > 0u &&
(*pevent->pLastLog)->type == dbfl_type_rec &&
pLog->type == dbfl_type_rec) {
db_delete_field_log(pLog);
UNLOCKEVQUE (ev_que);
return;
}
...
}
I don't quite get the logic here. What is (the definition of) an empty
event? And why does dbfl_type_rec indicate that the event is empty?
Probably a bad term.
A dbfl_type_rec update does not contain any data or metadata by itself - that's why I called it "empty". It's just a placeholder, signaling to the post-queue processing that it should use the current state and data of the record, including all metadata and timestamp.
Putting two consecutive dbfl_type_rec events on the queue would lead to an identical update (as all data is taken from the record) being sent twice. Not really useful, that's why I decided it to be safe to drop any consecutive dbfl_type_rec updates.
Cheers,
~Ralph