Hi all
I am reading with a ExcerptTailer (SingleChronicleQueue, version 4.5.15) from the queue and change the direction of reading.
I get some unexpected behavior I don't understand. Can someone tell me if I am doing or understanding something wrong,
or if this simply a bug?
First, I insert 4 values (for example the integer values 0-4) into the queue. `idx` indicates their index position in the queue:
Value | Idx
------+------
0 | 52
1 | 53
2 | 54
3 | 55
I then read with the ExerptTailer the values. The following table shows the operation ('read' for reading a value from the queue
and 'toggle' for changing the read direction of the Tailer), the return value and the tailer state after the performed operation:
Op | Return value | Tailer state
--------+--------------+----------------------------
read 0 direction=FORWARD, idx 53
read 1 direction=FORWARD, idx 54
toggle - direction=BACKWARD, idx 54
read 2 direction=BACKWARD, idx 53
read 1 direction=BACKWARD, idx 52
toggle - direction=FORWARD, idx 52
So far, so good. For the next 'read' operation I would now expect to get the value '0' back, the value at index position 52.
However, if I now read the next value I get:
read 2 direction=FORWARD, idx 53
read 3 direction=FORWARD, idx 54
toggle - direction=BACKWARD, idx 54
read 2 direction=BACKWARD, idx 53
Does this make sense and where is my misunderstanding?
Thanks & regards,
marcus