I want to know what the most recently enqueued item is in a queue. how do I find this out?
In other words, how to find the last item that a queue will dequeue ( or the most recently enqueued item)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Im not entirely sure what you are trying to achieve here, but the following might work, just check that the queue is not empty.
Im assuming that you are using python’s own
Queueobject, which I would recommend since its thread safe 🙂