If there are items in queue1, then the combiner should get one item from queue1 and send it to queue3 until queue1 is empty.
If queue1 is empty, only then the combiner should change its priority and should get one item from queue2 until queue1 gets an item. As soon as queue1 gets an item, the combiner should change its priority to queue1 and repeat the above process.