aio-libs / aiohttp-sse

Server-sent events support for aiohttp
Other
197 stars 36 forks source link

'EventSourceResponse' object has no attribute 'is_connected' #463

Closed sola-ed closed 8 months ago

sola-ed commented 8 months ago

Hey guys,

I'm using the latest version (2.1.0) of this library and tried to run the given example. However, I get the above AttributeError. Any idea of what is going on? Thanks in advance!

aiohttp: 3.9.3 aiohttp-sse: 2.1.0 python: 3.10.13 running on Linux.

Olegt0rr commented 8 months ago

.is_connected() method is not released to pypi yet

Workarounds:

  1. Use latest version from github: pip install git+https://github.com/aio-libs/aiohttp-sse.git
  2. Use not sse._ping_task.done() condition
Dreamsorcerer commented 8 months ago

Or the older version of the example was just while True, I believe.

sola-ed commented 8 months ago

I installed from github, as suggested by @Olegt0rr , and it works like a charm. Thanks for your efforts in this project!