def xpoll(self, channel_id=None, json=None, ack=False,<EOL>follow=False, pause=None, **kwargs):
def _ack(channel_id, **kwargs):<EOL><INDENT>r = self.ack(channel_id, **kwargs)<EOL>if not (<NUM_LIT:200> <= r.status_code < <NUM_LIT>):<EOL><INDENT>try:<EOL><INDENT>r_json = r.json()<EOL><DEDENT>except ValueError as e:<EOL><INDENT>raise PanCloudError('<STR_LIT>' % e)<EOL><DEDENT>if '<STR_LIT>' in r_json and '<STR_LIT>' in r_json:<EOL><INDENT>raise PanCloudError('<STR_LIT>' %<EOL>(r_json['<STR_LIT>'],<EOL>r_json['<STR_LIT>']))<EOL><DEDENT>else:<EOL><INDENT>raise PanCloudError('<STR_LIT>' % (r.status_code,<EOL>r.reason))<EOL><DEDENT><DEDENT>if r.status_code == <NUM_LIT:200>:<EOL><INDENT>return<EOL><DEDENT>else:<EOL><INDENT>raise PanCloudError('<STR_LIT>' %<EOL>r.status_code)<EOL><DEDENT><DEDENT>while True:<EOL><INDENT>r = self.poll(channel_id, json, **kwargs)<EOL>try:<EOL><INDENT>r_json = r.json()<EOL><DEDENT>except ValueError as e:<EOL><INDENT>raise PanCloudError('<STR_LIT>' % e)<EOL><DEDENT>if not (<NUM_LIT:200> <= r.status_code < <NUM_LIT>):<EOL><INDENT>if '<STR_LIT>' in r_json and '<STR_LIT>' in r_json:<EOL><INDENT>raise PanCloudError('<STR_LIT>' %<EOL>(r_json['<STR_LIT>'],<EOL>r_json['<STR_LIT>']))<EOL><DEDENT>else:<EOL><INDENT>raise PanCloudError('<STR_LIT>' % (r.status_code,<EOL>r.reason))<EOL><DEDENT><DEDENT>if not r_json and not follow:<EOL><INDENT>return<EOL><DEDENT>for x in r_json:<EOL><INDENT>yield x<EOL><DEDENT>if ack:<EOL><INDENT>_ack(channel_id, **kwargs)<EOL><DEDENT>if not r_json and pause is not None:<EOL><INDENT>self._debug('<STR_LIT>', pause)<EOL>time.sleep(pause)<EOL><DEDENT><DEDENT>
Retrieve logType, event entries iteratively in a non-greedy manner.

        Generator function to return logType, event entries from poll
        API request.

        Args:
            channel_id (str): The channel ID.
            json (dict): Payload/request body.
            ack (bool): True to acknowledge read.
            follow (bool): True to continue polling after channelId empty.
            pause (float): Seconds to sleep between poll when follow and channelId empty.
            **kwargs: Supported :meth:`~pancloud.httpclient.HTTPClient.request` parameters.

        Yields:
            dictionary with single logType and event entries.