Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 599 lines (404 sloc) 24.856 kb
37db4e0 Nico Taing [doc] add protocol.md
nicotaing authored
1 # Beanstalkd
2
3 ## Protocol
4
5 ### Description
6
7 The beanstalk protocol runs over TCP using ASCII encoding. Clients connect, send commands and data, wait for responses, and close the connection. For each connection, the server processes commands serially in the order in which they were received and sends responses in the same order. All integers in the protocol are formatted in decimal and (unless otherwise indicated) nonnegative.
8
9 ### Name convention
10
11 Names only supports ASCII strings.
12
13 #### Characters Allowed
14
15 * **letters** (A-Z and a-z)
16 * **numerals** (0-9)
17 * **hyphen** ("-")
18 * **plus** ("+")
19 * **slash** ("/")
20 * **semicolon** (";")
21 * **dot** (".")
22 * **dollar-sign** ("$")
23 * **underscore** ("_")
24 * **parentheses** ("*(*" and "*)*")
25
26 **Notice:** They may not begin with a hyphen and they are terminated by white space (either a space char or end of line). Each name must be at least one character long.
27
28 ### Errors
29
30 | Errors | Description |
31 | --------------------| ------------- |
32 | `OUT_OF_MEMORY\r\n` | The server cannot allocate enough memory for the job. The client should try again later.|
33 | `INTERNAL_ERROR\r\n` | This indicates a bug in the server. It should never happen. If it does happen, please report it at http://groups.google.com/group/beanstalk-talk. |
34 | `BAD_FORMAT\r\n` | The client sent a command line that was not well-formed. This can happen if the line does not end with \r\n, if non-numeric characters occur where an integer is expected, if the wrong number of arguments are present, or if the command line is mal-formed in any other way. |
35 | `UNKNOWN_COMMAND\r\n` | The client sent a command that the server does not know. |
36
37
38 ### Job Lifecycle
39
205548f Nico Taing [doc] fix job lifecycle description
nicotaing authored
40 A job in beanstalk gets created by a client with the `put` command. During its life it can be in one of four states: `ready`, `reserved`, `delayed`, or `buried`. After the `put` command, a job typically starts out ready. It waits in the ready queue until a worker comes along and runs the "reserve" command. If this job is next in the queue, it will be reserved for the worker. The worker will execute the job; when it is finished the worker will send a `delete` command to delete the job.
37db4e0 Nico Taing [doc] add protocol.md
nicotaing authored
41
42 | Status | Description |
43 | --------------------| ------------- |
205548f Nico Taing [doc] fix job lifecycle description
nicotaing authored
44 | `ready` | waiting to be reserved and processed after being put onto a tubed |
37db4e0 Nico Taing [doc] add protocol.md
nicotaing authored
45 | `reserved` | if this job is next in the queue, it will be reserved for the worker. The worker will execute the job |
205548f Nico Taing [doc] fix job lifecycle description
nicotaing authored
46 | `delayed` | waiting to become ready after the specified delay. |
47 | `buried` | waiting to be kicked, usually after job fails to process |
37db4e0 Nico Taing [doc] add protocol.md
nicotaing authored
48
49 Here is a picture of the typical job lifecycle:
50
51 ```
52 put reserve delete
53 -----> [READY] ---------> [RESERVED] --------> *poof*
54 ```
55
56
57
58 Here is a picture with more possibilities:
59
60 ```
61 put with delay release with delay
62 ----------------> [DELAYED] <------------.
63 | |
7b81226 Karen Etheridge show the delayed->ready transition via 'kick'
karenetheridge authored
64 kick | (time passes) |
37db4e0 Nico Taing [doc] add protocol.md
nicotaing authored
65 | |
66 put v reserve | delete
67 -----------------> [READY] ---------> [RESERVED] --------> *poof*
68 ^ ^ | |
69 | \ release | |
70 | `-------------' |
71 | |
72 | kick |
73 | |
74 | bury |
75 [BURIED] <---------------'
76 |
77 | delete
78 `--------> *poof*
79 ```
80
81 ### Tubes
82
83 The system has one or more tubes. Each tube consists of a ready queue and a delay queue. Each job spends its entire life in one tube. Consumers can show interest in tubes by sending the `watch` command; they can show disinterest by sending the `ignore` command. This set of interesting tubes is said to be a consumer's `watch list`. When a client reserves a job, it may come from any of the tubes in its watch list.
84
85 When a client connects, its watch list is initially just the tube named `default`. If it submits jobs without having sent a `use` command, they will live in the tube named `default`.
86
87 Tubes are created on demand whenever they are referenced. If a tube is empty (that is, it contains no `ready`, `delayed`, or `buried` jobs) and no client refers to it, it will be deleted.
88
89 ## Commands
90
91 ### Producer Commands
92
93 #### `put` command
94
95 The `put` command is for any process that wants to insert a job into the queue. It comprises a command line followed by the job body:
96
97 ```
98 put <pri> <delay> <ttr> <bytes>\r\n
99 <data>\r\n
100 ```
101
102 #####`put` options
103
104 It inserts a job into the client's currently used tube (see the `use` command below).
105
106 * `<pri>` is an integer < 2**32. Jobs with smaller priority values will be scheduled before jobs with larger priorities. The most urgent priority is 0;the least urgent priority is 4,294,967,295.
107 * `<delay>` is an integer number of seconds to wait before putting the job in the ready queue. The job will be in the "delayed" state during this time.
108 * `<ttr>` -- time to run -- is an integer number of seconds to allow a worker to run this job. This time is counted from the moment a worker reserves this job. If the worker does not delete, release, or bury the job within `<ttr>` seconds, the job will time out and the server will release the job. The minimum ttr is 1. If the client sends 0, the server will silently increase the ttr to 1.
109 * `<bytes>` is an integer indicating the size of the job body, not including the trailing "\r\n". This value must be less than max-job-size (default: 2**16).
110 * `<data>` is the job body -- a sequence of bytes of length <bytes> from the previous line.
111
112
113 ##### `put` responses
114 After sending the command line and body, the client waits for a reply, which
115 may be:
116
117 * `INSERTED <id>\r\n` to indicate success. `<id>` is the integer id of the new job
118 * `BURIED <id>\r\n` if the server ran out of memory trying to grow the priority queue data structure. `<id>` is the integer id of the new job
119 * `EXPECTED_CRLF\r\n` The job body must be followed by a CR-LF pair, that is, `"\r\n"`. These two bytes are not counted in the job size given by the client in the put command line.
120 * `JOB_TOO_BIG\r\n` The client has requested to put a job with a body larger than max-job-size bytes.
121 * `DRAINING\r\n` This means that the server has been put into "drain mode" and is no longer accepting new jobs. The client should try another server or disconnect and try again later.
122
123 #### `use` command
124
125 The `use` command is for producers. Subsequent put commands will put jobs into the tube specified by this command. If no use command has been issued, jobs will be put into the tube named `default`.
126
127 ```
128 use <tube>\r\n
129 ```
130
131 ##### `use` options
132
133 * `<tube>` is a name at most 200 bytes. It specifies the tube to use. If the tube does not exist, it will be created.
134
135 ##### `use` responses
136
137 * `USING <tube>\r\n` -- `<tube>` is the name of the tube now being used.
138
bf4dd7a Nico Taing [protocol.md] add bury description
nicotaing authored
139 ### Worker Commands
37db4e0 Nico Taing [doc] add protocol.md
nicotaing authored
140
141 A process that wants to consume jobs from the queue uses those commands:
142
143 * `reserve`
144 * `delete`
145 * `release`
146 * `bury`
147
148 #### `reserve` command
149
150 ```
151 reserve\r\n
152 ```
153
154 Alternatively, you can specify a timeout as follows:
155
156 ```
157 reserve-with-timeout <seconds>\r\n
158 ```
159
160 This will return a newly-reserved job. If no job is available to be reserved, beanstalkd will wait to send a response until one becomes available. Once a job is reserved for the client, the client has limited time to run (TTR) the job before the job times out. When the job times out, the server will put the job back into the ready queue. Both the TTR and the actual time left can be found in response to the `stats-job` command.
161
d8b2d9b Keith Rarick document unspecified job order within each pri
authored
162 If more than one job is ready, beanstalkd will choose the one with the
8cc3e6b Keith Rarick correctly document fifo order within each pri
authored
163 smallest priority value. Within each priority, it will choose the one that
164 was received first.
d8b2d9b Keith Rarick document unspecified job order within each pri
authored
165
37db4e0 Nico Taing [doc] add protocol.md
nicotaing authored
166 A timeout value of `0` will cause the server to immediately return either a response or `TIMED_OUT`. A positive value of timeout will limit the amount of time the client will block on the reserve request until a job becomes available.
167
168 ##### `reserve` responses
169
170 ###### Non-succesful responses
171
172 * `DEADLINE_SOON\r\n` During the TTR of a reserved job, the last second is kept by the server as a safety margin, during which the client will not be made to wait for another job. If the client issues a reserve command during the safety margin, or if the safety margin arrives while the client is waiting on a reserve command.
c2ee0f3 Keith Rarick correctly check for hangup during reserve
authored
173 * `TIMED_OUT\r\n` If a non-negative timeout was specified and the timeout exceeded before a job became available, or if the client's connection is half-closed, the server will respond with TIMED_OUT.
37db4e0 Nico Taing [doc] add protocol.md
nicotaing authored
174
175 Otherwise, the only other response to this command is a successful reservation
176 in the form of a text line followed by the job body:
177
178 ####### Succesful response
179
180
181 ```
182 RESERVED <id> <bytes>\r\n
183 <data>\r\n
184 ```
185
186 * `<id>` is the job id -- an integer unique to this job in this instance of beanstalkd.
187 * `<bytes>` is an integer indicating the size of the job body, not including the trailing `\r\n"`.
188 * `<data>` is the job body -- a sequence of bytes of length <bytes> from the previous line. This is a verbatim copy of the bytes that were originally sent to the server in the put command for this job.
189
190 #### `delete` command
191
192 The delete command removes a job from the server entirely. It is normally used by the client when the job has successfully run to completion. A client can delete jobs that it has `reserved`, `ready` jobs, `delayed` jobs, and jobs that are
193 `buried`. The delete command looks like this:
194
195 ```
196 delete <id>\r\n
197 ```
198
199 ##### `delete` options
200
201 * `<id>` is the job id to delete.
202
203 ##### `delete` responses
204
205 The client then waits for one line of response, which may be:
206
207 * `DELETED\r\n` to indicate success.
208 * `NOT_FOUND\r\n` if the job does not exist or is not either reserved by the client, ready, or buried. This could happen if the job timed out before the client sent the delete command.
209
210 #### `release` command
211
212 The release command puts a `reserved` job back into the ready queue (and marks its state as `ready`) to be run by any client. It is normally used when the job fails because of a transitory error. It looks like this:
213
214 ```
215 release <id> <pri> <delay>\r\n
216 ```
217
218 ##### `release` options
219
220 * `<id>` is the job id to release.
221 * `<pri>` is a new priority to assign to the job.
222 * `<delay>` is an integer number of seconds to wait before putting the job in the ready queue. The job will be in the "delayed" state during this time.
223
224 ##### `release` responses
225
226 The client expects one line of response, which may be:
227
228 * `RELEASED\r\n` to indicate success.
229 * `BURIED\r\n` if the server ran out of memory trying to grow the priority queue data structure.
230 * `NOT_FOUND\r\n` if the job does not exist or is not reserved by the client.
231
bf4dd7a Nico Taing [protocol.md] add bury description
nicotaing authored
232 #### `bury` command
233 The bury command puts a job into the "buried" state. Buried jobs are put into a FIFO linked list and will not be touched by the server again until a client kicks them with the `kick`" command.
234
235 The bury command looks like this:
236
237 ```
238 bury <id> <pri>\r\n
239 ```
240
241 ##### `bury` options
242
243 * `<id>` is the job id to release.
244 * `<pri>` is a new priority to assign to the job.
245
246 ##### `bury` responses
247
248 There are two possible responses:
249
250 * `BURIED\r\n` to indicate success.
251 * `NOT_FOUND\r\n` if the job does not exist or is not reserved by the client.
252
253
37db4e0 Nico Taing [doc] add protocol.md
nicotaing authored
254 #### `touch` command
255
157d88b Jens Rantil Document `touch` command's TTR reset
JensRantil authored
256 The `touch` command allows a worker to request more time to work on a job. This is useful for jobs that potentially take a long time, but you still want the benefits of a TTR pulling a job away from an unresponsive worker. A worker may periodically tell the server that it's still alive and processing a job (e.g. it may do this on `DEADLINE_SOON`). The command postpones the auto release of a reserved job until TTR seconds from when the command is issued.
257
37db4e0 Nico Taing [doc] add protocol.md
nicotaing authored
258
259 The touch command looks like this:
260
261 ```
262 touch <id>\r\n
263 ```
264
265 ##### `touch` options
266
267 * `<id>` is the ID of a job reserved by the current connection.
268
269 ##### `touch` responses
270
271 There are two possible responses:
272
273 * `TOUCHED\r\n` to indicate success.
274 * `NOT_FOUND\r\n` if the job does not exist or is not reserved by the client.
275
276 #### `watch` command
277
278 The `watch` command adds the named tube to the watch list for the current connection. A reserve command will take a job from any of the tubes in the watch list. For each new connection, the watch list initially consists of one tube, named `default`.
279
280 ```
281 watch <tube>\r\n
282 ```
283
284 ##### `watch` options
285
286 * `<tube>` is a name at most 200 bytes. It specifies a tube to add to the watch list. If the tube doesn't exist, it will be created.
287
288 ##### `watch` responses
289
290 The reply is:
291
292 * `WATCHING <count>\r\n` `<count>` is the integer number of tubes currently in the watch list.
293
294 ##### `ignore` command
295
296 The `ignore` command is for consumers. It removes the named tube from the watch list for the current connection.
297
298 ```
299 ignore <tube>\r\n
300 ```
301
302 ##### `ignore` options
303
304 * `<tube>` is a name at most 200 bytes. It specifies a tube to add to the watch list. If the tube doesn't exist, it will be created.
305
306 ##### `ignore` command
307
308 The reply is one of:
309
310 * `WATCHING <count>\r\n` to indicate success. `<count>` is the integer number of tubes currently in the watch list.
311 * `NOT_IGNORED\r\n` if the client attempts to ignore the only tube in its watch list.
312
313 ### Other Commands
314
315 #### `peek` command
316
317 The peek commands let the client inspect a job in the system. There are four variations. All but the first operate only on the currently used tube.
318
319 * `peek <id>\r\n` - return `job <id>`.
320 * `peek-ready\r\n` - return the next ready job.
321 * `peek-delayed\r\n` - return the delayed job with the shortest delay left.
322 * `peek-buried\r\n` - return the next job in the list of buried jobs.
323
324 ##### `peek` responses
325
326 There are two possible responses, either a single line:
327
328 * `NOT_FOUND\r\n` if the requested job doesn't exist or there are no jobs in the requested state.
329 * `FOUND <id> <bytes>\r\n <data>\r\n`
330 * `<id>` is the job id.
331 * `<bytes>` is an integer indicating the size of the job body, not including the trailing `\r\n`.
332 * `<data>` is the job body -- a sequence of bytes of length <bytes> from the previous line.
333
334 #### `kick` command
335
336 The kick command applies only to the currently used tube. It moves jobs into the ready queue. If there are any buried jobs, it will only kick buried jobs. Otherwise it will kick delayed jobs. It looks like:
337
338 ```
339 kick <bound>\r\n
340 ```
341
342 ##### `kick` options
343
344 * `<bound>` is an integer upper bound on the number of jobs to kick. The server will kick no more than <bound> jobs.
345
346 ##### `kick` responses
347
348 The response is of the form:
349
350 * `KICKED <count>\r\n`
351 * <count> is an integer indicating the number of jobs actually kicked.
352
353 #### `kick-job` command
354
355 The kick-job command is a variant of kick that operates with a single job identified by its job id. If the given job id exists and is in a buried or delayed state, it will be moved to the ready queue of the the same tube where it currently belongs. The syntax is:
356
357 ```
358 kick-job <id>\r\n
359 ```
360
361 ##### `kick-job` options
362
363 * <id> is the job id to kick.
364
365 ##### `kick-job` responses
366
367 The response is one of:
368
369 * `NOT_FOUND\r\n` if the job does not exist or is not in a kickable state. This can also happen upon internal errors.
370 * `KICKED\r\n` when the operation succeeded.
371
2e6d305 Joel Bradshaw Fixing a few "stats-jobs" typos
cincodenada authored
372 #### `stats-job` command
37db4e0 Nico Taing [doc] add protocol.md
nicotaing authored
373
374 The stats-job command gives statistical information about the specified job if it exists. Its form is:
375
376 ```
377 stats-job <id>\r\n
378 ```
379
2e6d305 Joel Bradshaw Fixing a few "stats-jobs" typos
cincodenada authored
380 ##### `stats-job` options
37db4e0 Nico Taing [doc] add protocol.md
nicotaing authored
381
382 * `<id>` is a job id.
383
2e6d305 Joel Bradshaw Fixing a few "stats-jobs" typos
cincodenada authored
384 ##### `stats-job` responses
37db4e0 Nico Taing [doc] add protocol.md
nicotaing authored
385
386 The response is one of:
387
388 * `NOT_FOUND\r\n` if the job does not exist.
389 * `OK <bytes>\r\n<data>\r\n`
390 * `<bytes>` is the size of the following data section in bytes.
391 * `<data>` is a sequence of bytes of length `<bytes>` from the previous line. It is a YAML file with statistical information represented a dictionary.
392
393 The `stats-job` data is a YAML file representing a single dictionary of strings to scalars. It contains these keys:
394
395 * `id` is the job id
396 * `tube` is the name of the tube that contains this job
397 * `state` is `ready` or `delayed` or `reserved` or `buried`
398 * `pri` is the priority value set by the put, release, or bury commands.
399 * `age` is the time in seconds since the put command that created this job.
400 * `time-left` is the number of seconds left until the server puts this job into the ready queue. This number is only meaningful if the job is reserved or delayed. If the job is reserved and this amount of time elapses before its state changes, it is considered to have timed out.
401 * `file` is the number of the earliest binlog file containing this job. If -b wasn't used, this will be 0.
402 * `reserves` is the number of times this job has been reserved.
403 * `timeouts` is the number of times this job has timed out during a reservation.
404 * `releases` is the number of times a client has released this job from a reservation.
405 * `buries` is the number of times this job has been buried.
406 * `kicks` is the number of times this job has been kicked.
407
408 #### `stats-tube` command
409
410 The stats-tube command gives statistical information about the specified tube if it exists. Its form is:
411
412 ```
413 stats-tube <tube>\r\n
414 ```
415
416 ##### `stats-tube` options
417
418 * `<tube>` is a name at most 200 bytes. Stats will be returned for this tube.
419
420 ##### `stats-tube` responses
421
422 The response is one of:
423
424 * `NOT_FOUND\r\n` if the tube does not exist.
425 * `OK <bytes>\r\n<data>\r\n`
426 * `<bytes>` is the size of the following data section in bytes.
427 * `<data>` is a sequence of bytes of length `<bytes>` from the previous line. It is a YAML file with statistical information represented a dictionary.
428
429 The stats-tube data is a YAML file representing a single dictionary of strings to scalars. It contains these keys:
430
431 * `name` is the tube's name.
432 * `current-jobs-urgent` is the number of ready jobs with priority < 1024 in this tube.
433 * `current-jobs-ready` is the number of jobs in the ready queue in this tube.
434 * `current-jobs-reserved` is the number of jobs reserved by all clients in this tube.
435 * `current-jobs-delayed` is the number of delayed jobs in this tube.
436 * `current-jobs-buried` is the number of buried jobs in this tube.
437 * `total-jobs` is the cumulative count of jobs created in this tube in the current beanstalkd process.
438 * `current-using` is the number of open connections that are currently using this tube.
439 * `current-waiting` is the number of open connections that have issued a reserve command while watching this tube but not yet received a response.
440 * `current-watching` is the number of open connections that are currently watching this tube.
441 * `pause` is the number of seconds the tube has been paused for.
442 * `cmd-delete` is the cumulative number of delete commands for this tube
443 * `cmd-pause-tube` is the cumulative number of pause-tube commands for this tube.
444 * `pause-time-left` is the number of seconds until the tube is un-paused.
445
446 #### `stats` command
447
448 The stats command gives statistical information about the system as a whole. Its form is:
449
450 ```
451 stats\r\n
452 ```
453
454 ##### `stats` responses
455
456 The server will respond:
457
458 ```
459 OK <bytes>\r\n
460 <data>\r\n
461 ```
462
463 * `<bytes>` is the size of the following data section in bytes.
464 * `<data>` is a sequence of bytes of length <bytes> from the previous line. It is a YAML file with statistical information represented a dictionary.
465
466 The stats data for the system is a YAML file representing a single dictionary of strings to scalars. Entries described as "cumulative" are reset when the beanstalkd process starts; they are not stored on disk with the -b flag.
467
468 * `current-jobs-urgent` is the number of ready jobs with priority < 1024.
469 * `current-jobs-ready` is the number of jobs in the ready queue.
470 * `current-jobs-reserved` is the number of jobs reserved by all clients.
471 * `current-jobs-delayed` is the number of delayed jobs.
472 * `current-jobs-buried` is the number of buried jobs.
473 * `cmd-put` is the cumulative number of put commands.
474 * `cmd-peek` is the cumulative number of peek commands.
475 * `cmd-peek-ready` is the cumulative number of peek-ready commands.
476 * `cmd-peek-delayed` is the cumulative number of peek-delayed commands.
477 * `cmd-peek-buried` is the cumulative number of peek-buried commands.
478 * `cmd-reserve` is the cumulative number of reserve commands.
479 * `cmd-use` is the cumulative number of use commands.
480 * `cmd-watch` is the cumulative number of watch commands.
481 * `cmd-ignore` is the cumulative number of ignore commands.
482 * `cmd-delete` is the cumulative number of delete commands.
483 * `cmd-release` is the cumulative number of release commands.
484 * `cmd-bury` is the cumulative number of bury commands.
485 * `cmd-kick` is the cumulative number of kick commands.
486 * `cmd-stats` is the cumulative number of stats commands.
487 * `cmd-stats-job` is the cumulative number of stats-job commands.
488 * `cmd-stats-tube` is the cumulative number of stats-tube commands.
489 * `cmd-list-tubes` is the cumulative number of list-tubes commands.
490 * `cmd-list-tube-used` is the cumulative number of list-tube-used commands.
491 * `cmd-list-tubes-watched` is the cumulative number of list-tubes-watched commands.
76adfd9 Keith Rarick don't over-specify the format of stats id field
authored
492 * `cmd-pause-tube` is the cumulative number of pause-tube commands.
37db4e0 Nico Taing [doc] add protocol.md
nicotaing authored
493 * `job-timeouts` is the cumulative count of times a job has timed out.
494 * `total-jobs` is the cumulative count of jobs created.
495 * `max-job-size` is the maximum number of bytes in a job.
496 * `current-tubes` is the number of currently-existing tubes.
497 * `current-connections` is the number of currently open connections.
498 * `current-producers` is the number of open connections that have each issued at least one put command.
499 * `current-workers` is the number of open connections that have each issued at least one reserve command.
500 * `current-waiting` is the number of open connections that have issued a reserve command but not yet received a response.
501 * `total-connections` is the cumulative count of connections.
502 * `pid` is the process id of the server.
503 * `version` is the version string of the server.
504 * `rusage-utime` is the cumulative user CPU time of this process in seconds and microseconds.
505 * `rusage-stime` is the cumulative system CPU time of this process in seconds and microseconds.
506 * `uptime` is the number of seconds since this server process started running.
76adfd9 Keith Rarick don't over-specify the format of stats id field
authored
507 * `binlog-oldest-index` is the index of the oldest binlog file needed to store the current jobs.
508 * `binlog-current-index` is the index of the current binlog file being written to. If binlog is not active this value will be 0.
509 * `binlog-max-size` is the maximum size in bytes a binlog file is allowed to get before a new binlog file is opened.
510 * `binlog-records-written` is the cumulative number of records written to the binlog.
511 * `binlog-records-migrated` is the cumulative number of records written as part of compaction.
512 * `id` is a random id string for this server process, generated when each beanstalkd process starts.
513 * `hostname` is the hostname of the machine as determined by uname.
37db4e0 Nico Taing [doc] add protocol.md
nicotaing authored
514
515 #### `list-tubes` command
516
517 The list-tubes command returns a list of all existing tubes. Its form is:
518
519 ```
520 list-tubes\r\n
521 ```
522
523 ##### `list-tubes` responses
524
525 The response is:
526
527 ```
528 OK <bytes>\r\n
529 <data>\r\n
530 ```
531
532 * `<bytes>` is the size of the following data section in bytes.
533 * `<data>` is a sequence of bytes of length <bytes> from the previous line. It is a YAML file containing all tube names as a list of strings.
534
535 #### `list-tube-used` command
536
537 The list-tube-used command returns the tube currently being used by the client. Its form is:
538
539 ```
540 list-tube-used\r\n
541 ```
542
543 ##### `list-tube-used` responses
544 The response is:
545
546 ```
547 USING <tube>\r\n
548 ```
549
550 * `<tube>` is the name of the tube being used.
551
552 #### `list-tubes-watched` command
553
554 The list-tubes-watched command returns a list tubes currently being watched by the client. Its form is:
555
556 ```
557 list-tubes-watched\r\n
558 ```
559
560 ##### `list-tubes-watched` responses
561
562 The response is:
563
564 ```
565 OK <bytes>\r\n
566 <data>\r\n
567 ```
568
569 * `<bytes>` is the size of the following data section in bytes.
570 * `<data>` is a sequence of bytes of length <bytes> from the previous line. It is a YAML file containing watched tube names as a list of strings.
571
572 #### `quit` command
573
574 The quit command simply closes the connection. Its form is:
575
576 ```
577 quit\r\n
578 ```
579
580 #### `pause-tube` command
581
582 The pause-tube command can delay any new job being reserved for a given time. Its form is:
583
584 ```
585 pause-tube <tube-name> <delay>\r\n
586 ```
587
588 ##### `pause-tube` options
589
590 * `<tube>` is the tube to pause
591 * `<delay>` is an integer number of seconds to wait before reserving any more jobs from the queue
592
593 ##### `pause-tube` responses
594
595 There are two possible responses:
596
597 * `PAUSED\r\n` to indicate success.
2e6d305 Joel Bradshaw Fixing a few "stats-jobs" typos
cincodenada authored
598 * `NOT_FOUND\r\n` if the tube does not exist.
Something went wrong with that request. Please try again.