-
I just discovered there is a // With multiple responses.
for msg in nc.request_multi("foo", "Help")?.iter() {} https://docs.rs/nats/latest/nats/#requestresponse Is there a recommended way to achieve the same behavior in go? |
Beta Was this translation helpful? Give feedback.
Answered by
Jarema
Apr 2, 2024
Replies: 1 comment 1 reply
-
You can achieve the same goal creating a subscription first: // with callback
nc.Subscribe("service", cb)
// or a sync variant
nc.SubscribeSync("service") and then send request: nc.PublishRequest("requestTo", "service", []byte("data")) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Doomsta
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Request
is usingPublish
andSubscribe
under the hood.You can achieve the same goal creating a subscription first:
and then send request: