{"action":"created","issue":{"url":"https://api.github.com/repos/collectiveidea/delayed_job/issues/845","labels_url":"https://api.github.com/repos/collectiveidea/delayed_job/issues/845/labels{/name}","comments_url":"https://api.github.com/repos/collectiveidea/delayed_job/issues/845/comments","events_url":"https://api.github.com/repos/collectiveidea/delayed_job/issues/845/events","html_url":"https://github.com/collectiveidea/delayed_job/pull/845","id":106134307,"number":845,"title":"Queue priority in config","user":{"login":"ryannealmes","id":5302894,"avatar_url":"https://avatars.githubusercontent.com/u/5302894?v=3","gravatar_id":"","url":"https://api.github.com/users/ryannealmes","html_url":"https://github.com/ryannealmes","followers_url":"https://api.github.com/users/ryannealmes/followers","following_url":"https://api.github.com/users/ryannealmes/following{/other_user}","gists_url":"https://api.github.com/users/ryannealmes/gists{/gist_id}","starred_url":"https://api.github.com/users/ryannealmes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryannealmes/subscriptions","organizations_url":"https://api.github.com/users/ryannealmes/orgs","repos_url":"https://api.github.com/users/ryannealmes/repos","events_url":"https://api.github.com/users/ryannealmes/events{/privacy}","received_events_url":"https://api.github.com/users/ryannealmes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-09-12T05:55:59Z","updated_at":"2015-11-16T00:02:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/collectiveidea/delayed_job/pulls/845","html_url":"https://github.com/collectiveidea/delayed_job/pull/845","diff_url":"https://github.com/collectiveidea/delayed_job/pull/845.diff","patch_url":"https://github.com/collectiveidea/delayed_job/pull/845.patch"},"body":"Queue priority is not settable via a config file. This causes complications when you want to set queue priority and leverage ActiveJob in Rails. In order to allow setting queue priority I have created a queue_attributes attribute that falls off the worker. The attribute is then accessed and the priority is set when setting up the job prior to enqueuing.\r\n\r\nI have extracted the enqueueing code into it's own class to try and clean things up a little into a `JobPreparer` for a lack of a better name.\r\n\r\nSome side notes it may be better to rather use the `queue` attribute on the worker, but I thought this was a good start.\r\n\r\nThis is my first public PR to someone else's repo. I have read the guidelines ... I am happy if it's rejected, but input on where I can improve in future or how I can change things to provide similar functionality would be much appreciated.\r\n\r\nSomeone also started a [thread](https://github.com/collectiveidea/delayed_job/issues/782) requesting this functionality."},"comment":{"url":"https://api.github.com/repos/collectiveidea/delayed_job/issues/comments/156877421","html_url":"https://github.com/collectiveidea/delayed_job/pull/845#issuecomment-156877421","issue_url":"https://api.github.com/repos/collectiveidea/delayed_job/issues/845","id":156877421,"user":{"login":"sferik","id":10308,"avatar_url":"https://avatars.githubusercontent.com/u/10308?v=3","gravatar_id":"","url":"https://api.github.com/users/sferik","html_url":"https://github.com/sferik","followers_url":"https://api.github.com/users/sferik/followers","following_url":"https://api.github.com/users/sferik/following{/other_user}","gists_url":"https://api.github.com/users/sferik/gists{/gist_id}","starred_url":"https://api.github.com/users/sferik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sferik/subscriptions","organizations_url":"https://api.github.com/users/sferik/orgs","repos_url":"https://api.github.com/users/sferik/repos","events_url":"https://api.github.com/users/sferik/events{/privacy}","received_events_url":"https://api.github.com/users/sferik/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T00:02:16Z","updated_at":"2015-11-16T00:02:16Z","body":"Looks good to me! Thanks for the patch!"}}