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