{"action":"opened","issue":{"url":"https://api.github.com/repos/ybrs/pydisque/issues/18","labels_url":"https://api.github.com/repos/ybrs/pydisque/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/ybrs/pydisque/issues/18/comments","events_url":"https://api.github.com/repos/ybrs/pydisque/issues/18/events","html_url":"https://github.com/ybrs/pydisque/issues/18","id":124019718,"number":18,"title":"PAUSE needs to be implemented...","user":{"login":"canardleteer","id":11901726,"avatar_url":"https://avatars.githubusercontent.com/u/11901726?v=3","gravatar_id":"","url":"https://api.github.com/users/canardleteer","html_url":"https://github.com/canardleteer","followers_url":"https://api.github.com/users/canardleteer/followers","following_url":"https://api.github.com/users/canardleteer/following{/other_user}","gists_url":"https://api.github.com/users/canardleteer/gists{/gist_id}","starred_url":"https://api.github.com/users/canardleteer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/canardleteer/subscriptions","organizations_url":"https://api.github.com/users/canardleteer/orgs","repos_url":"https://api.github.com/users/canardleteer/repos","events_url":"https://api.github.com/users/canardleteer/events{/privacy}","received_events_url":"https://api.github.com/users/canardleteer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-28T05:23:16Z","updated_at":"2015-12-28T05:23:16Z","closed_at":null,"body":"If anyone else can get to this before me... Got a lot going on out here.\r\n\r\n...\r\n\r\nPAUSE <queue-name> option1 [option2 ... optionN]\r\n\r\nControl the paused state of a queue, possibly broadcasting the command to other nodes in the cluster. Disque queues can be paused in both directions, input and output, or both. Pausing a queue makes it not available for input or output operations. Specifically:\r\n\r\nA queue paused in input will have change behavior in the following way:\r\n\r\n    ADDJOB returns a -PAUSED error for queues paused in input.\r\n    The node where the queue is paused, no longer accept to replicate jobs for this queue when requested by other nodes. Since ADDJOB by default uses synchronous replication, it means that if the queue is paused in enough nodes, adding jobs with a specified level of replication may fail. In general the node where the queue is paused will not create new jobs in the local node about this queue.\r\n    The job no longer accepts ENQUEUE messages from other nodes. Those messages are usually used by nodes in out of memory conditions that replicate jobs externally (not holding a copy), in order to put the job in the queue of some random node, among the nodes having a copy of a job.\r\n    Active jobs that reach their retry time, are not put back into the queue. Instead their retry timer is updated and the node will try again later.\r\n\r\nBasically a queue paused in input never creates new jobs for this queue, and never puts active jobs (jobs for which the node have a copy but are not currently queued) back in the queue, for all the time the queue is paused.\r\n\r\nA queue paused in output instead will behave in the following way:\r\n\r\n    GETJOB will block even if there are jobs available in the specified queue, instead of serving the jobs. But GETJOB will unblock if the queue output pause will be cleared later.\r\n    The node will not provide jobs to other nodes in the context of nodes federation, for paused queues.\r\n\r\nSo a queue paused in output will stop to act as a source of messages for both local and non local clients.\r\n\r\nThe paused state can be set for each queue using the PAUSE command followed by options to specify how to change the paused state. Possible options are:\r\n\r\n    in: pause the queue in input.\r\n    out: pause the queue in output.\r\n    all: pause the queue in input and output (same as specifying both the in and out options).\r\n    none: clear the paused state in input and output.\r\n    state: just report the current queue state.\r\n    bcast: send a PAUSE command to all the reachable nodes of the cluster to set the same queue in the other nodes to the same state.\r\n\r\nThe command always returns the state of the queue after the execution of the specified options, so the return value is one of in, out, all, none.\r\n\r\nQueues paused in input or output are never evicted to reclaim memory, even if they are empty and inactive for a long time, since otherwise the paused state would be forgot.\r\n\r\nFor example in order to block output for the queue myqueue in all the nodes currently reachable, the following command should be send to a single node:\r\n\r\nPAUSE myqueue out bcast\r\n\r\nTo specify all is the same as to specify both in and out, so the two following forms are equivalent:\r\n\r\nPAUSE myqueue in out\r\nPAUSE myqueue all\r\n\r\nTo just get the current state use:\r\n\r\nPAUSE myqueue state\r\n\"none\"\r\n"}}