{"action":"created","issue":{"url":"https://api.github.com/repos/iron-io/iron_mq_python/issues/34","labels_url":"https://api.github.com/repos/iron-io/iron_mq_python/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/iron-io/iron_mq_python/issues/34/comments","events_url":"https://api.github.com/repos/iron-io/iron_mq_python/issues/34/events","html_url":"https://github.com/iron-io/iron_mq_python/issues/34","id":54018201,"number":34,"title":"reverse queue, peek via postion?","user":{"login":"sirvon","id":1570089,"avatar_url":"https://avatars.githubusercontent.com/u/1570089?v=3","gravatar_id":"","url":"https://api.github.com/users/sirvon","html_url":"https://github.com/sirvon","followers_url":"https://api.github.com/users/sirvon/followers","following_url":"https://api.github.com/users/sirvon/following{/other_user}","gists_url":"https://api.github.com/users/sirvon/gists{/gist_id}","starred_url":"https://api.github.com/users/sirvon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirvon/subscriptions","organizations_url":"https://api.github.com/users/sirvon/orgs","repos_url":"https://api.github.com/users/sirvon/repos","events_url":"https://api.github.com/users/sirvon/events{/privacy}","received_events_url":"https://api.github.com/users/sirvon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-12T03:43:56Z","updated_at":"2015-01-12T03:54:16Z","closed_at":"2015-01-12T03:54:16Z","body":"Does the ability to peek/get message off queue by its position exists?\r\n\r\nfor instance, to get the 3rd to last message.\r\n\r\nor\r\n\r\nReverse the queue and have the last message turn into the first?\r\n\r\nI know I probably can peek, and then start to parse my way to a solution.\r\n\r\nBut is there an in built solution that would eliminate a few lines of code and some time off the design of a solution.\r\n\r\nthanks!\r\n"},"comment":{"url":"https://api.github.com/repos/iron-io/iron_mq_python/issues/comments/69527862","html_url":"https://github.com/iron-io/iron_mq_python/issues/34#issuecomment-69527862","issue_url":"https://api.github.com/repos/iron-io/iron_mq_python/issues/34","id":69527862,"user":{"login":"edsrzf","id":369904,"avatar_url":"https://avatars.githubusercontent.com/u/369904?v=3","gravatar_id":"","url":"https://api.github.com/users/edsrzf","html_url":"https://github.com/edsrzf","followers_url":"https://api.github.com/users/edsrzf/followers","following_url":"https://api.github.com/users/edsrzf/following{/other_user}","gists_url":"https://api.github.com/users/edsrzf/gists{/gist_id}","starred_url":"https://api.github.com/users/edsrzf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edsrzf/subscriptions","organizations_url":"https://api.github.com/users/edsrzf/orgs","repos_url":"https://api.github.com/users/edsrzf/repos","events_url":"https://api.github.com/users/edsrzf/events{/privacy}","received_events_url":"https://api.github.com/users/edsrzf/received_events","type":"User","site_admin":false},"created_at":"2015-01-12T03:54:16Z","updated_at":"2015-01-12T03:54:16Z","body":"Neither reversing the queue or getting a message by position are directly supported because they're not really in the spirit of a queue.\r\n\r\nHowever, you could try calling `peek` with `max` == 3, for example, to get the third message from the queue. Beware that `peek` is not guaranteed to return the number of messages you ask for even if there are enough messages on the queue. It will, however, return at least one (assuming there's at least one on the queue).\r\n\r\nI'm going to go ahead and close this issue. It's best to email support@iron.io if you have further questions."}}