()
| 168 | } |
| 169 | |
| 170 | func ExampleConn_FlushTimeout() { |
| 171 | nc, _ := nats.Connect(nats.DefaultURL) |
| 172 | defer nc.Close() |
| 173 | |
| 174 | msg := &nats.Msg{Subject: "foo", Reply: "bar", Data: []byte("Hello World!")} |
| 175 | for i := 0; i < 1000; i++ { |
| 176 | nc.PublishMsg(msg) |
| 177 | } |
| 178 | // Only wait for up to 1 second for Flush |
| 179 | err := nc.FlushTimeout(1 * time.Second) |
| 180 | if err == nil { |
| 181 | // Everything has been processed by the server for nc *Conn. |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | func ExampleConn_Request() { |
| 186 | nc, _ := nats.Connect(nats.DefaultURL) |
nothing calls this directly
no test coverage detected