def run(self, limit=None, timeout=None):
        """
        Consume the event stream.
        :param timeout: Duration of the connection timeout.
        :type timeout: int
        :param limit: Number of events to consume.
        :type limit: int
        :rtype: None
        """
        counter = 0
        self.stream = sseclient.SSEClient(self.endpoint)
        while True:
            with utils.Timeout(timeout):
                try:
                    event = next(self.stream)
                except StopIteration:
                    continue
                else:
                    if not event.data:
                        continue
                    self.main_callback(event.data)
                    counter += 1
                    if limit and counter >= limit:
                        return