In the above body(), I get only 1 item at a time.
The total number of items I can get is unknown a priori.
My goal is to reorder the items.
E.g. if the incoming items are A, B, C, the output should be (randomly) B, A, C.
How do I do this?
I am allowed to use a queue for storing "tmp".
I am not allowed to change the behaviour of the upstream sequence.
Please let me know. Thank You!