mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
9 lines
521 B
Markdown
9 lines
521 B
Markdown
# 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"
|
|
|