Debian Codegraph @

vendor/clue/redis-protocol/src/Clue/Redis/Protocol/Parser/ParserInterface.php

raw
1 <?php
2
3 namespace Clue\Redis\Protocol\Parser;
4
5 use Clue\Redis\Protocol\Model\ModelInterface;
6 use Clue\Redis\Protocol\Parser\ParserException;
7
8 interface ParserInterface
9 {
10 /**
11 * push a chunk of the redis protocol message into the buffer and parse
12 *
13 * You can push any number of bytes of a redis protocol message into the
14 * parser and it will try to parse messages from its data stream. So you can
15 * pass data directly from your socket stream and the parser will return the
16 * right amount of message model objects for you.
17 *
18 * If you pass an incomplete message, expect it to return an empty array. If
19 * your incomplete message is split to across multiple chunks, the parsed
20 * message model will be returned once the parser has sufficient data.
21 *
22 * @param string $dataChunk
23 * @return ModelInterface[] 0+ message models
24 * @throws ParserException if the message can not be parsed
25 * @see self::popIncomingModel()
26 */
27 public function pushIncoming($dataChunk);
28 }