h-message-bus 0.0.21__py3-none-any.whl → 0.0.22__py3-none-any.whl
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.
- h_message_bus/adapters/nats_publisher_adapter.py +10 -5
- h_message_bus/application/message_publisher.py +1 -1
- {h_message_bus-0.0.21.dist-info → h_message_bus-0.0.22.dist-info}/METADATA +1 -1
- {h_message_bus-0.0.21.dist-info → h_message_bus-0.0.22.dist-info}/RECORD +6 -6
- {h_message_bus-0.0.21.dist-info → h_message_bus-0.0.22.dist-info}/WHEEL +0 -0
- {h_message_bus-0.0.21.dist-info → h_message_bus-0.0.22.dist-info}/top_level.txt +0 -0
@@ -23,12 +23,17 @@ class NatsPublisherAdapter(MessagePublisher):
|
|
23
23
|
def __init__(self, nats_client: NatsClientRepository):
|
24
24
|
self.nats_client = nats_client
|
25
25
|
|
26
|
-
async def publish(self, message: HaiMessage)
|
26
|
+
async def publish(self, message: HaiMessage):
|
27
27
|
"""Publish a message to NATS."""
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
try:
|
29
|
+
|
30
|
+
await self.nats_client.publish(
|
31
|
+
message.topic,
|
32
|
+
message.to_json().encode()
|
33
|
+
)
|
34
|
+
except Exception as e:
|
35
|
+
print(f"Failed to publish message: {e}")
|
36
|
+
return
|
32
37
|
|
33
38
|
async def request(self, message: HaiMessage, timeout: float = 2.0) -> Optional[HaiMessage]:
|
34
39
|
"""Send a request and wait for a response."""
|
@@ -2,11 +2,11 @@ __init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
h_message_bus/__init__.py,sha256=T_07sHtXLlRuLwK-BRVfFIIOGc48TKbtVLvKtIw2K5U,516
|
3
3
|
h_message_bus/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
h_message_bus/adapters/nats_message_adapter.py,sha256=-hzx0UJmKJT4VWfRA_zVT68hddl9dejvUiSdLU1rY-w,1378
|
5
|
-
h_message_bus/adapters/nats_publisher_adapter.py,sha256=
|
5
|
+
h_message_bus/adapters/nats_publisher_adapter.py,sha256=kIh7J-eS-MPvfGsnmdGwsWYfLgepBC99v5d04KXyOaE,1900
|
6
6
|
h_message_bus/adapters/nats_subscriber_adapter.py,sha256=WX7xvJhVJVa24CRpWGG3SE8CLP7AXcO6ky-qhMTICCY,2072
|
7
7
|
h_message_bus/application/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
h_message_bus/application/message_processor.py,sha256=1vdVfPn1BUDmswJ-Y5aS-YDbLSizrjX6_CMIBa5SGjc,734
|
9
|
-
h_message_bus/application/message_publisher.py,sha256=
|
9
|
+
h_message_bus/application/message_publisher.py,sha256=pYX4JzJLe7L_59gKVYBLqT6iTwFB73zhbzxd7yv2TqI,834
|
10
10
|
h_message_bus/application/message_subcriber.py,sha256=2yqUUHVHtZlA6-zzyHzghdWQ7ZmdcFic5c0xi_rgG-M,741
|
11
11
|
h_message_bus/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
12
|
h_message_bus/domain/event_messages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -32,7 +32,7 @@ h_message_bus/domain/request_messages/web_search_request_message.py,sha256=ZoB4i
|
|
32
32
|
h_message_bus/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
33
|
h_message_bus/infrastructure/nats_client_repository.py,sha256=lAapNaL0rqBr-9KaHcexuo5XLmSWRWspkJWXS9dMqPU,3371
|
34
34
|
h_message_bus/infrastructure/nats_config.py,sha256=Yzqqd1bCfmUv_4FOnA1dvqIpakzV0BUL2_nXQcndWvo,1304
|
35
|
-
h_message_bus-0.0.
|
36
|
-
h_message_bus-0.0.
|
37
|
-
h_message_bus-0.0.
|
38
|
-
h_message_bus-0.0.
|
35
|
+
h_message_bus-0.0.22.dist-info/METADATA,sha256=EwONbFsl__2n8Yv_5q2_Qyx7JguhaTqt4yrp2Yghb_M,8834
|
36
|
+
h_message_bus-0.0.22.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
37
|
+
h_message_bus-0.0.22.dist-info/top_level.txt,sha256=BArjhm_lwFR9yJJEIf-LT_X64psuLkXFdbpQRJUreFE,23
|
38
|
+
h_message_bus-0.0.22.dist-info/RECORD,,
|
File without changes
|
File without changes
|