Skip to content

Commit

Permalink
fix: NatsJS reply-to support
Browse files Browse the repository at this point in the history
  • Loading branch information
Lancetnik committed Aug 21, 2023
1 parent 88887a0 commit c20424a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion propan/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from unittest.mock import Mock

__version__ = "0.1.5.19"
__version__ = "0.1.5.20"


INSTALL_MESSAGE = (
Expand Down
7 changes: 1 addition & 6 deletions propan/brokers/nats/nats_js_broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,6 @@ async def publish(
if reply_to:
raise WRONG_PUBLISH_ARGS

token = client._nuid.next()
token.extend(token_hex(2).encode())
reply_to = token.decode()

if reply_to:
future: asyncio.Future[Msg] = asyncio.Future()
sub = await client.subscribe(reply_to, future=future, max_msgs=1)
await sub.unsubscribe(limit=1)
Expand All @@ -308,7 +303,7 @@ async def publish(
stream=self._stream_config.name,
)

if reply_to:
if callback:
msg: Any = None
with scope(callback_timeout):
msg = await future
Expand Down

0 comments on commit c20424a

Please sign in to comment.