1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00
Derek Collison 99da6d13d0 Updates
Signed-off-by: Derek Collison <derek@nats.io>
2019-06-06 15:42:25 -07:00

518 B

Synchronous Subscriptions

Synchronous subscriptions require the application to wait for messages. This type of subscription is easy to set-up and use, but requires the application to deal with looping if multiple messages are expected. For situations where a single message is expected, synchronous subscriptions are sometimes easier to manage, depending on the language.

For example, to subscribe to the subject updates and receive a single message you could do:

!INCLUDE "../../_examples/subscribe_sync.html"