Skip to content

Commit

Permalink
docs: add Publish example to pubsub docs (#1729)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistermoe authored Jun 11, 2024
1 parent 75a9995 commit 9d069d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/content/docs/reference/pubsub.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,11 @@ func SendInvoiceEmail(ctx context.Context, in Invoice) error {
}
```

Events can be published to a topic like so:

```go
invoicesTopic.Publish(ctx, Invoice{...})
```

> **NOTE!**
> PubSub topics cannot be published to from outside the module that declared them, they can only be subscribed to. That is, if a topic is declared in module `A`, module `B` cannot publish to it.

0 comments on commit 9d069d4

Please sign in to comment.