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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: eric-sse
3
- Version: 0.7.2.dev1
3
+ Version: 0.7.3
4
4
  Summary: A lightweight message dispatcher based on SSE protocol data transfer objects format
5
5
  License: MIT
6
6
  Keywords: sse,queue,concurrency
@@ -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 InvalidListenerException(f'Channel with id {channel.id} already exists')
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
- del self.__channels[channel_id]
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.2.dev1"
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