Created
January 9, 2023 13:10
-
-
Save glober-vaibhav/2c6f42da9032eed49910693ab39a1b16 to your computer and use it in GitHub Desktop.
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
func main() { | |
// Create a new agent | |
agent := NewAgent() | |
// Subscribe to a topic | |
sub := agent.Subscribe("foo") | |
// Publish a message to the topic | |
go agent.Publish("foo", "hello world") | |
// Print the message | |
fmt.Println(<-sub) | |
// Close the agent | |
agent.Close() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment