{"action":"created","issue":{"url":"https://api.github.com/repos/resque/resque/issues/1324","labels_url":"https://api.github.com/repos/resque/resque/issues/1324/labels{/name}","comments_url":"https://api.github.com/repos/resque/resque/issues/1324/comments","events_url":"https://api.github.com/repos/resque/resque/issues/1324/events","html_url":"https://github.com/resque/resque/pull/1324","id":101118479,"number":1324,"title":"Add Resque.priority_enqueue","user":{"login":"thenovices","id":237647,"avatar_url":"https://avatars.githubusercontent.com/u/237647?v=3","gravatar_id":"","url":"https://api.github.com/users/thenovices","html_url":"https://github.com/thenovices","followers_url":"https://api.github.com/users/thenovices/followers","following_url":"https://api.github.com/users/thenovices/following{/other_user}","gists_url":"https://api.github.com/users/thenovices/gists{/gist_id}","starred_url":"https://api.github.com/users/thenovices/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thenovices/subscriptions","organizations_url":"https://api.github.com/users/thenovices/orgs","repos_url":"https://api.github.com/users/thenovices/repos","events_url":"https://api.github.com/users/thenovices/events{/privacy}","received_events_url":"https://api.github.com/users/thenovices/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-14T22:55:20Z","updated_at":"2015-08-22T00:57:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/resque/resque/pulls/1324","html_url":"https://github.com/resque/resque/pull/1324","diff_url":"https://github.com/resque/resque/pull/1324.diff","patch_url":"https://github.com/resque/resque/pull/1324.patch"},"body":"Adds the ability to add jobs to the front of a queue via `Resque.priority_enqueue`\r\nand `Resque.priority_enqueue_to`. This is done by calling redis's `LPUSH` command\r\ninstead of `RPUSH`.\r\n\r\nAddresses #1323 \r\n\r\nSadly due to the use of `*args` in the relevant functions, I couldn't see an easy way to extend the existing functions, so I created duplicates. If you know of a way to DRY things up, please let me know.\r\n\r\nAlso, if you have a recommendation for better method names, let me know. I realize that priority_enqueue could potentially be confused with priority queues, which should allow assignment of a specific priority level, whereas in this case, the implementation only allows you to put a job at the front of the queue. An alternative is to use the term `unshift` instead of `enqueue`.\r\n\r\nI added a couple of tests; let me know if there are any other tests that would be helpful."},"comment":{"url":"https://api.github.com/repos/resque/resque/issues/comments/133620650","html_url":"https://github.com/resque/resque/pull/1324#issuecomment-133620650","issue_url":"https://api.github.com/repos/resque/resque/issues/1324","id":133620650,"user":{"login":"hoffmanc","id":191607,"avatar_url":"https://avatars.githubusercontent.com/u/191607?v=3","gravatar_id":"","url":"https://api.github.com/users/hoffmanc","html_url":"https://github.com/hoffmanc","followers_url":"https://api.github.com/users/hoffmanc/followers","following_url":"https://api.github.com/users/hoffmanc/following{/other_user}","gists_url":"https://api.github.com/users/hoffmanc/gists{/gist_id}","starred_url":"https://api.github.com/users/hoffmanc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoffmanc/subscriptions","organizations_url":"https://api.github.com/users/hoffmanc/orgs","repos_url":"https://api.github.com/users/hoffmanc/repos","events_url":"https://api.github.com/users/hoffmanc/events{/privacy}","received_events_url":"https://api.github.com/users/hoffmanc/received_events","type":"User","site_admin":false},"created_at":"2015-08-22T00:57:36Z","updated_at":"2015-08-22T00:57:36Z","body":"AFAIK, queues are cheap, so that doesn't seem like a major headache to me.  In the last company I worked for, we had at least 50 different queues, and each one had it's own high (and low) variations.  If you are following a convention (e.g., all high priority queues are the original queue name plus `_high`), the changes to whatever code is pushing jobs onto queues  and spinning up workers should require minimal code change.  But perhaps I am mistaken."}}