Created
October 19, 2022 15:15
-
-
Save AseemWangoo/13cd8a94e80e5380d9ddaadc49d87f0f to your computer and use it in GitHub Desktop.
Publish using redis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Sample payload we are sending using pub/sub | |
| { | |
| "id":"116c24b1-9425-4fe4-aec2-86ba7384733e", | |
| "name":"Bob", | |
| "age":29, | |
| "source":"cache" | |
| } | |
| // Publish using Redis PubSub | |
| payload, err := json.Marshal(resp) | |
| if err := c.client.Publish("send-user-name", payload).Err(); err != nil { | |
| log.Fatal(err) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment