summaryrefslogtreecommitdiff
path: root/intern.gospeladlershof.de/vendor/pda/pheanstalk/src/Command.php
blob: 798db22e9d7a239e60b8ee8b5bc6954d30089023 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php

namespace Pheanstalk;

/**
 * A command to be sent to the beanstalkd server, and response processing logic
 *
 * @author Paul Annesley
 * @package Pheanstalk
 * @license http://www.opensource.org/licenses/mit-license.php
 */
interface Command
{
    const COMMAND_PUT = 'put';
    const COMMAND_USE = 'use';
    const COMMAND_RESERVE = 'reserve';
    const COMMAND_DELETE = 'delete';
    const COMMAND_RELEASE = 'release';
    const COMMAND_BURY = 'bury';
    const COMMAND_WATCH = 'watch';
    const COMMAND_IGNORE = 'ignore';
    const COMMAND_PEEK = 'peek';
    const COMMAND_KICK = 'kick';
    const COMMAND_STATS_JOB = 'stats-job';
    const COMMAND_STATS = 'stats';
    const COMMAND_LIST_TUBES = 'list-tubes';
    const COMMAND_LIST_TUBE_USED = 'list-tube-used';
    const COMMAND_LIST_TUBES_WATCHED = 'list-tubes-watched';

    /**
     * The command line, without trailing CRLF
     * @return string
     */
    public function getCommandLine();

    /**
     * Whether the command is followed by data
     * @return boolean
     */
    public function hasData();

    /**
     * The binary data to follow the command
     * @return string
     * @throws Exception\CommandException If command has no data
     */
    public function getData();

    /**
     * The length of the binary data in bytes
     * @return int
     * @throws Exception\CommandException If command has no data
     */
    public function getDataLength();

    /**
     * The response parser for the command.
     * @return ResponseParser
     */
    public function getResponseParser();
}