2 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
3 // +---------------------------------------------------------------------------
4 // | SWAN [ $_SWANBR_SLOGAN_$ ]
5 // +---------------------------------------------------------------------------
6 // | Copyright $_SWANBR_COPYRIGHT_$
7 // +---------------------------------------------------------------------------
8 // | Version $_SWANBR_VERSION_$
9 // +---------------------------------------------------------------------------
10 // | Licensed ( $_SWANBR_LICENSED_URL_$ )
11 // +---------------------------------------------------------------------------
12 // | $_SWANBR_WEB_DOMAIN_$
13 // +---------------------------------------------------------------------------
15 namespace Kafka\Protocol\Fetch\Helper;
18 +------------------------------------------------------------------------------
19 * Kafka protocol since Kafka v0.8
20 +------------------------------------------------------------------------------
23 * @version $_SWANBR_VERSION_$
25 * @author $_SWANBR_AUTHOR_$
26 +------------------------------------------------------------------------------
29 class FreeStream extends HelperAbstract
39 protected $streams = array();
43 // {{{ public function __construct()
51 public function __construct($client)
53 $this->client = $client;
57 // {{{ public function setStreams()
65 public function setStreams($streams)
67 $this->streams = $streams;
71 // {{{ public function onStreamEof()
76 * @param string $streamKey
80 public function onStreamEof($streamKey)
82 if (isset($this->streams[$streamKey])) {
83 $this->client->freeStream($streamKey);
88 // {{{ public function onTopicEof()
93 * @param string $topicName
97 public function onTopicEof($topicName)
102 // {{{ public function onPartitionEof()
105 * on partition eof call
107 * @param \Kafka\Protocol\Fetch\Partition $partition
111 public function onPartitionEof($partition)