()
| 90 | } |
| 91 | |
| 92 | func ExampleConn_ForceReconnect() { |
| 93 | nc, _ := nats.Connect(nats.DefaultURL) |
| 94 | defer nc.Close() |
| 95 | |
| 96 | nc.Subscribe("foo", func(m *nats.Msg) { |
| 97 | fmt.Printf("Received a message: %s\n", string(m.Data)) |
| 98 | }) |
| 99 | |
| 100 | // Reconnect to the server. |
| 101 | // the subscription will be recreated after the reconnect. |
| 102 | nc.ForceReconnect() |
| 103 | } |
| 104 | |
| 105 | // This Example shows a synchronous subscriber. |
| 106 | func ExampleConn_SubscribeSync() { |
nothing calls this directly
no test coverage detected