()
| 154 | } |
| 155 | |
| 156 | func ExampleConn_Flush() { |
| 157 | nc, _ := nats.Connect(nats.DefaultURL) |
| 158 | defer nc.Close() |
| 159 | |
| 160 | msg := &nats.Msg{Subject: "foo", Reply: "bar", Data: []byte("Hello World!")} |
| 161 | for i := 0; i < 1000; i++ { |
| 162 | nc.PublishMsg(msg) |
| 163 | } |
| 164 | err := nc.Flush() |
| 165 | if err == nil { |
| 166 | // Everything has been processed by the server for nc *Conn. |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | func ExampleConn_FlushTimeout() { |
| 171 | nc, _ := nats.Connect(nats.DefaultURL) |
nothing calls this directly
no test coverage detected