Open grizzly-monkey opened 7 years ago
Only if we can make the operation O(1), which is doubtful without changing file queue format.
what is current file queue format why will it not be done in o(1) can we not peek to the last entry ?
The current format is:
<<Size:32, BinaryTerm:Size/binary, ...>>
So, obviously, we can only peek in O(N) to the last element. In order to peek in O(1), we need to have something like:
<<Size:32, BinaryTerm:Size/binary, Size:32, ...>>
Thanks for the clarity @zinid for now i am using ram queues so without changing p1_q i am managing last in my module. However if we can get this change in p1_q it would be awesome i am not sure how big this change format is for file queue but if we can get this it will be really great .
OK, I will try to look at it ASAP.
Thank you Sir.
Can we please add functionality to get last element from queue()
Thanks Jeet