fixed example formatting
This commit is contained in:
@@ -28,7 +28,7 @@ type MyMessage struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func consumer(msg MyMessage) {
|
func consumer(msg MyMessage) {
|
||||||
fmt.Printf("Hello %s", msg.Name)
|
fmt.Printf("Hello %s", msg.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -39,8 +39,8 @@ func main() {
|
|||||||
|
|
||||||
topic.Subscribe(gubgub.Forever(consumer))
|
topic.Subscribe(gubgub.Forever(consumer))
|
||||||
|
|
||||||
// The AsyncTopic doesn't wait for the subscriber to be registered so, for the purposes of this
|
// The AsyncTopic doesn't wait for the subscriber to be registered so, for the purposes of this
|
||||||
// example, we sleep on it.
|
// example, we sleep on it.
|
||||||
time.Sleep(time.Millisecond)
|
time.Sleep(time.Millisecond)
|
||||||
|
|
||||||
topic.Publish(MyMessage{Name: "John Smith"})
|
topic.Publish(MyMessage{Name: "John Smith"})
|
||||||
|
|||||||
Reference in New Issue
Block a user