| 1 |
--- |
| 2 |
title: "Pub/Sub" |
| 3 |
date: 2019-03-26T09:44:06-07:00 |
| 4 |
showInSidenav: true |
| 5 |
--- |
| 6 |
|
| 7 |
The [`pubsub` package][] provides an easy and portable way to interact with |
| 8 |
publish/subscribe systems. This guide shows how to work with pubsub |
| 9 |
in the Go CDK. |
| 10 |
|
| 11 |
<!--more--> |
| 12 |
|
| 13 |
The [publish/subscribe model][] allows parts of a system to publish messages |
| 14 |
that other parts of a system may subscribe to. This is commonly used to |
| 15 |
arrange for work to happen at some point after an interactive frontend |
| 16 |
request is finished or in other event-driven computing. |
| 17 |
|
| 18 |
The [`pubsub` package][] supports operations to publish messages to a topic and |
| 19 |
to subscribe to receive messages from a topic. |
| 20 |
|
| 21 |
Subpackages contain driver implementations of pubsub for various services, |
| 22 |
including Cloud and on-prem solutions. You can develop your application |
| 23 |
locally using [`mempubsub`][], then deploy it to multiple Cloud providers with |
| 24 |
minimal initialization reconfiguration. |
| 25 |
|
| 26 |
[publish/subscribe model]: https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern |
| 27 |
[`pubsub` package]: https://godoc.org/gocloud.dev/pubsub |
| 28 |
[`mempubsub`]: https://godoc.org/gocloud.dev/pubsub/mempubsub |
| 29 |
|