eric-sse 0.7.0__tar.gz → 0.7.2.dev1__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.0 → eric_sse-0.7.2.dev1}/PKG-INFO +1 -1
- {eric_sse-0.7.0 → eric_sse-0.7.2.dev1}/eric_sse/entities.py +6 -2
- {eric_sse-0.7.0 → eric_sse-0.7.2.dev1}/pyproject.toml +3 -1
- {eric_sse-0.7.0 → eric_sse-0.7.2.dev1}/LICENSE +0 -0
- {eric_sse-0.7.0 → eric_sse-0.7.2.dev1}/README.md +0 -0
- {eric_sse-0.7.0 → eric_sse-0.7.2.dev1}/eric_sse/__init__.py +0 -0
- {eric_sse-0.7.0 → eric_sse-0.7.2.dev1}/eric_sse/clients.py +0 -0
- {eric_sse-0.7.0 → eric_sse-0.7.2.dev1}/eric_sse/exception.py +0 -0
- {eric_sse-0.7.0 → eric_sse-0.7.2.dev1}/eric_sse/message.py +0 -0
- {eric_sse-0.7.0 → eric_sse-0.7.2.dev1}/eric_sse/prefabs.py +0 -0
- {eric_sse-0.7.0 → eric_sse-0.7.2.dev1}/eric_sse/queue.py +0 -0
- {eric_sse-0.7.0 → eric_sse-0.7.2.dev1}/eric_sse/servers.py +0 -0
|
@@ -5,7 +5,7 @@ from threading import Lock
|
|
|
5
5
|
from typing import AsyncIterable, Any
|
|
6
6
|
|
|
7
7
|
import eric_sse
|
|
8
|
-
from eric_sse.exception import InvalidListenerException, NoMessagesException
|
|
8
|
+
from eric_sse.exception import InvalidListenerException, NoMessagesException, InvalidChannelException
|
|
9
9
|
from eric_sse.message import MessageContract, Message
|
|
10
10
|
from eric_sse.queue import Queue, AbstractMessageQueueFactory, InMemoryMessageQueueFactory
|
|
11
11
|
|
|
@@ -124,6 +124,9 @@ class AbstractChannel(ABC):
|
|
|
124
124
|
except KeyError:
|
|
125
125
|
raise InvalidListenerException(f"Invalid listener {listener_id}")
|
|
126
126
|
|
|
127
|
+
def _set_queue(self, listener_id: str, queue: Queue):
|
|
128
|
+
self.__queues[listener_id] = queue
|
|
129
|
+
|
|
127
130
|
def dispatch(self, listener_id: str, msg: MessageContract):
|
|
128
131
|
"""Adds a message to listener's queue"""
|
|
129
132
|
|
|
@@ -172,7 +175,8 @@ class AbstractChannel(ABC):
|
|
|
172
175
|
yield self.adapt(message)
|
|
173
176
|
|
|
174
177
|
await asyncio.sleep(self.stream_delay_seconds)
|
|
175
|
-
|
|
178
|
+
except (InvalidListenerException, InvalidChannelException) as e:
|
|
179
|
+
yield self.adapt(Message(msg_type='error', msg_payload=e))
|
|
176
180
|
except Exception as e:
|
|
177
181
|
logger.debug(traceback.format_exc())
|
|
178
182
|
logger.error(e)
|
|
@@ -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.2.dev1"
|
|
6
6
|
authors = [
|
|
7
7
|
{name = "Luca Stretti", email = "laxertu@gmail.com"}
|
|
8
8
|
]
|
|
@@ -36,6 +36,8 @@ sphinx = "^8.1.1"
|
|
|
36
36
|
sphinx-markdown-builder = "^0.6.7"
|
|
37
37
|
sphinx-book-theme = "^1.1.3"
|
|
38
38
|
|
|
39
|
+
|
|
40
|
+
[tool.setuptools_scm]
|
|
39
41
|
[project.optional-dependencies]
|
|
40
42
|
redis-queues = [
|
|
41
43
|
"eric-redis-queues (>=0.0.4, <0.0.5)"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|