danielbeardsley/beanstalkd — pull request #1 by danielbeardsley (2013-10-02 00:41:59+00:00)
Title: Add Command: "wait <id>" that responds when a job is deleted

Add a command: `wait \r\n` that responds with `DELETED \r\n` or
`BURIED \r\n` only once a job has been deleted or buried.

This allows a client to be notified about the status of a job without
polling.

The wait command waits until a particular job is out of the system
before responding. It can be used to block a client until a job is
completed. It looks like this:

```
wait \r\n
```

* `` is the job id to wait for.

The client expects one line of response once the state of the job has
changed, which may be:

* `DELETED \r\n` to indicate the job was deleted via the `delete`
command (normal success).
* `BURIED \r\n` to indicate the job was buried via the `bury`
command.
* `NOT_FOUND\r\n` if the job id does not exist.

A response won't be sent by the server until the specified job is
deleted or buried. The wait command can be issued multiple times before
a response is received in order to wait on a collection of jobs.