Workqueue - implement round-robin processing

It will be discussed with @washi

Configuration Setting for how many rows should be processed before moving to the next queue, default value 1.

Algorithm description

Invocation

At the moment there’s periodical timer with interval 10 second. This will be changed to the interval specified in origamSettings meaning the delay between the processing cycles. After processing cycle is finished, the delay interval should be started and at its end the new processing cycle should be invoked.

Processing Cycle

flowchart TD Start([Start]) --> GetList GetList(Get list of relevant work queues) --> ForEachQueue{For each queue} ForEachQueue --> |Next Queue| ProcessEntries(Process given number of entries - specified by origamSettings) ProcessEntries --> NoMoreEntries{No more entries in queue?} NoMoreEntries --> |true| MarkQueue(Mark queue as processed) MarkQueue --> ForEachQueue NoMoreEntries --> |false| ForEachQueue ForEachQueue --> |No Queue| AllQueuesProcessed{Are all queues marked as processed?} AllQueuesProcessed --> |false| ResetQueues(Reset queue flags) ResetQueues --> GetList AllQueuesProcessed --> |true| End([End])

I am not sure if scheduling should not be also part of this. So e.g. “process all the entries starting at midnight” (which is different to throttling, e.g. “process max. 1 entry per second”, which is different to scheduling per entry, e.g. “process this entry next week”).

So instead of setting up the interval in origamSettings, why not setting it per queue?

I think that the scheduling is out of scope of this task and it should be solved separately.

Maybe “scheduling” is not the right word. In essence it is just “per queue setting”.