]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - vendor/nmred/kafka-php/src/Kafka/Protocol/Fetch/Helper/FreeStream.php
MediaWiki 1.30.2-scripts
[autoinstalls/mediawiki.git] / vendor / nmred / kafka-php / src / Kafka / Protocol / Fetch / Helper / FreeStream.php
1 <?php
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 // +---------------------------------------------------------------------------
14
15 namespace Kafka\Protocol\Fetch\Helper;
16
17 /**
18 +------------------------------------------------------------------------------
19 * Kafka protocol since Kafka v0.8
20 +------------------------------------------------------------------------------
21 *
22 * @package
23 * @version $_SWANBR_VERSION_$
24 * @copyright Copyleft
25 * @author $_SWANBR_AUTHOR_$
26 +------------------------------------------------------------------------------
27 */
28
29 class FreeStream extends HelperAbstract
30 {
31     // {{{ members
32
33     /**
34      * streams
35      *
36      * @var array
37      * @access protected
38      */
39     protected $streams = array();
40
41     // }}}
42     // {{{ functions
43     // {{{ public function __construct()
44
45     /**
46      * __construct
47      *
48      * @access public
49      * @param $client
50      */
51     public function __construct($client)
52     {
53         $this->client = $client;
54     }
55
56     // }}}
57     // {{{ public function setStreams()
58
59     /**
60      * set streams
61      *
62      * @access public
63      * @param $streams
64      */
65     public function setStreams($streams)
66     {
67         $this->streams = $streams;
68     }
69
70     // }}}
71     // {{{ public function onStreamEof()
72
73     /**
74      * on stream eof call
75      *
76      * @param string $streamKey
77      * @access public
78      * @return void
79      */
80     public function onStreamEof($streamKey)
81     {
82         if (isset($this->streams[$streamKey])) {
83             $this->client->freeStream($streamKey);
84         }
85     }
86
87     // }}}
88     // {{{ public function onTopicEof()
89
90     /**
91      * on topic eof call
92      *
93      * @param string $topicName
94      * @access public
95      * @return void
96      */
97     public function onTopicEof($topicName)
98     {
99     }
100
101     // }}}
102     // {{{ public function onPartitionEof()
103
104     /**
105      * on partition eof call
106      *
107      * @param \Kafka\Protocol\Fetch\Partition $partition
108      * @access public
109      * @return void
110      */
111     public function onPartitionEof($partition)
112     {
113     }
114
115     // }}}
116     // }}}
117 }