Close stops the processor and waits for it to finish.
()
| 9867 | |
| 9868 | // Close stops the processor and waits for it to finish. |
| 9869 | func (p *Server) Close() error { |
| 9870 | if unsub := p.configCacheUnsubscribe; unsub != nil { |
| 9871 | p.configCacheUnsubscribe = nil |
| 9872 | unsub() |
| 9873 | } |
| 9874 | p.cancel() |
| 9875 | p.wg.Wait() |
| 9876 | p.drainInflight() |
| 9877 | return nil |
| 9878 | } |
| 9879 | |
| 9880 | // drainInflight waits for all in-flight operations to complete. |
| 9881 | // It acquires inflightMu to prevent processOnce from spawning |