Skip to content

Commit

Permalink
fix: correct NatsJS rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
Lancetnik committed Aug 21, 2023
1 parent f6f6acb commit 8f3c384
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions propan/brokers/nats/nats_js_broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ async def publish(

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

reply_to = token.decode()
future: asyncio.Future[Msg] = asyncio.Future()
sub = await client.subscribe(token.decode(), future=future, max_msgs=1)
sub = await client.subscribe(reply_to, future=future, max_msgs=1)
await sub.unsubscribe(limit=1)

if raise_timeout:
Expand Down
2 changes: 1 addition & 1 deletion tests/brokers/base/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async def m(): # pragma: no cover
await full_broker.start()

r = await full_broker.publish(
"hello", queue, callback_timeout=3, callback=True
"hello", queue, callback_timeout=3, callback=True, raise_timeout=True
)
assert r == "1"

Expand Down

0 comments on commit 8f3c384

Please sign in to comment.