A long-polling method that queries Syncthing for events..

            Args:
                using_url (str): REST HTTP endpoint
                filters (List[str]): Creates an "event group" in Syncthing to
                    only receive events that have been subscribed to.
                limit (int): The number of events to query in the history
                    to catch up to the current state.

            Returns:
                generator[dict]

def _events(self, using_url, filters=None, limit=None):
        """ A long-polling method that queries Syncthing for events..

            Args:
                using_url (str): REST HTTP endpoint
                filters (List[str]): Creates an "event group" in Syncthing to
                    only receive events that have been subscribed to.
                limit (int): The number of events to query in the history
                    to catch up to the current state.

            Returns:
                generator[dict]
        """

        # coerce
        if not isinstance(limit, (int, NoneType)):
            limit = None

        # coerce
        if filters is None:
            filters = []

        # format our list into the correct expectation of string with commas
        if isinstance(filters, string_types):
            filters = filters.split(',')

        # reset the state if the loop was broken with `stop`
        if not self.blocking:
            self.blocking = True

        # block/long-poll for updates to the events api
        while self.blocking:
            params = {
                'since': self._last_seen_id,
                'limit': limit,
            }

            if filters:
                params['events'] = ','.join(map(str, filters))

            try:
                data = self.get(using_url, params=params, raw_exceptions=True)
            except (ConnectTimeout, ConnectionError) as e:
                # swallow timeout errors for long polling
                data = None
            except Exception as e:
                reraise('', e)

            if data:
                # update our last_seen_id to move our event counter forward
                self._last_seen_id = data[-1]['id']
                for event in data:
                    # handle potentially multiple events returned in a list
                    self._count += 1
                    yield event