eric-sse 0.7.2.dev1__tar.gz → 0.7.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {eric_sse-0.7.2.dev1 → eric_sse-0.7.3}/PKG-INFO +1 -1
- {eric_sse-0.7.2.dev1 → eric_sse-0.7.3}/eric_sse/entities.py +2 -0
- {eric_sse-0.7.2.dev1 → eric_sse-0.7.3}/eric_sse/servers.py +5 -2
- {eric_sse-0.7.2.dev1 → eric_sse-0.7.3}/pyproject.toml +1 -1
- {eric_sse-0.7.2.dev1 → eric_sse-0.7.3}/LICENSE +0 -0
- {eric_sse-0.7.2.dev1 → eric_sse-0.7.3}/README.md +0 -0
- {eric_sse-0.7.2.dev1 → eric_sse-0.7.3}/eric_sse/__init__.py +0 -0
- {eric_sse-0.7.2.dev1 → eric_sse-0.7.3}/eric_sse/clients.py +0 -0
- {eric_sse-0.7.2.dev1 → eric_sse-0.7.3}/eric_sse/exception.py +0 -0
- {eric_sse-0.7.2.dev1 → eric_sse-0.7.3}/eric_sse/message.py +0 -0
- {eric_sse-0.7.2.dev1 → eric_sse-0.7.3}/eric_sse/prefabs.py +0 -0
- {eric_sse-0.7.2.dev1 → eric_sse-0.7.3}/eric_sse/queue.py +0 -0
|
@@ -154,6 +154,8 @@ class AbstractChannel(ABC):
|
|
|
154
154
|
async def message_stream(self, listener: MessageQueueListener) -> AsyncIterable[Any]:
|
|
155
155
|
"""
|
|
156
156
|
Entry point for message streaming
|
|
157
|
+
|
|
158
|
+
A message with type = 'error' is yeld on invalid listener or channel
|
|
157
159
|
"""
|
|
158
160
|
|
|
159
161
|
def new_messages():
|
|
@@ -24,7 +24,7 @@ class SSEChannelContainer:
|
|
|
24
24
|
def add(self) -> SSEChannel:
|
|
25
25
|
channel = SSEChannel()
|
|
26
26
|
if channel.id in self.__channels:
|
|
27
|
-
raise
|
|
27
|
+
raise InvalidChannelException(f'Channel with id {channel.id} already exists')
|
|
28
28
|
self.__channels[channel.id] = channel
|
|
29
29
|
return channel
|
|
30
30
|
|
|
@@ -35,7 +35,10 @@ class SSEChannelContainer:
|
|
|
35
35
|
raise InvalidChannelException(f'No channel with id {channel_id}')
|
|
36
36
|
|
|
37
37
|
def rm(self, channel_id: str):
|
|
38
|
-
|
|
38
|
+
try:
|
|
39
|
+
del self.__channels[channel_id]
|
|
40
|
+
except KeyError:
|
|
41
|
+
raise InvalidChannelException(f'No channel with id {channel_id}')
|
|
39
42
|
|
|
40
43
|
|
|
41
44
|
class SocketServer:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name = "eric-sse"
|
|
3
3
|
description = "A lightweight message dispatcher based on SSE protocol data transfer objects format"
|
|
4
4
|
requires-python = ">=3.10, <3.12"
|
|
5
|
-
version = "0.7.
|
|
5
|
+
version = "0.7.3"
|
|
6
6
|
authors = [
|
|
7
7
|
{name = "Luca Stretti", email = "laxertu@gmail.com"}
|
|
8
8
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|