()
| 117 | } |
| 118 | |
| 119 | func ExampleSubscription_NextMsg() { |
| 120 | nc, _ := nats.Connect(nats.DefaultURL) |
| 121 | defer nc.Close() |
| 122 | |
| 123 | sub, _ := nc.SubscribeSync("foo") |
| 124 | m, err := sub.NextMsg(1 * time.Second) |
| 125 | if err == nil { |
| 126 | fmt.Printf("Received a message: %s\n", string(m.Data)) |
| 127 | } else { |
| 128 | fmt.Println("NextMsg timed out.") |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | func ExampleSubscription_Unsubscribe() { |
| 133 | nc, _ := nats.Connect(nats.DefaultURL) |
nothing calls this directly
no test coverage detected