Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement PAUSE #27

Closed
mariano opened this issue Mar 7, 2016 · 3 comments
Closed

Implement PAUSE #27

mariano opened this issue Mar 7, 2016 · 3 comments

Comments

@mariano
Copy link
Owner

mariano commented Mar 7, 2016

PAUSE <queue-name> option1 [option2 ... optionN]

The 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:

  • in: pause the queue in input.
  • out: pause the queue in output.
  • all: pause the queue in input and output (same as specifying both the in and out options).
  • none: clear the paused state in input and output.
  • state: just report the current queue state.
  • 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.

The 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.

For example, in order to block output for the queue myqueue in all the currently reachable nodes, the following command should be send to a single node:

PAUSE myqueue out bcast

To specify all is the same as to specify both in and out, so the two following forms are equivalent:

PAUSE myqueue in out
PAUSE myqueue all

To just get the current state use:

PAUSE myqueue state
"none"
@Revisor
Copy link

Revisor commented Mar 7, 2016

From the Disque docs:

  • ADDJOB returns a -PAUSED error for queues paused in input.

What should happen in Disque-php? Right now ADDJOB on a paused queue would return ResponseException, if I'm not mistaken. Is that what we want? Maybe return a more specialised QueuePausedException in that case?

@mariano
Copy link
Owner Author

mariano commented Mar 7, 2016

@Revisor same as #28 I see the need to extend ResponseException for some known exceptions, such as -PAUSED and -LEAVING, since they have a meaning for the client code. On this particular case for ADDJOB a -PAUSED should raise a QueuePausedException as you are saying, which allows for easy management in userland.

@Revisor
Copy link

Revisor commented Mar 7, 2016

Sounds good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants