def METHOD_NAME(self, config, connected, early_terminate):
    expected_terminate_message = "502 Bad Gateway"
    url = config.get_url() + self.sse_endpoint
    with requests.get(url, timeout=5, stream=True) as resp:
        with connected:
            connected.notifyAll()
        lines = 0
        for line in resp.iter_lines():
            if expected_terminate_message.encode() == line:
                break
            lines += 1
            if early_terminate and lines == 2:
                return
        # /sse returns count followed by 2 new lines
        assert lines >= (self.grace_period * 2)