Stop gracefully stops the outbox processor. It signals the processor to stop and waits for pending work to complete.
()
| 118 | // Stop gracefully stops the outbox processor. |
| 119 | // It signals the processor to stop and waits for pending work to complete. |
| 120 | func (p *LineageOutboxProcessor) Stop() { |
| 121 | p.mu.Lock() |
| 122 | if !p.running { |
| 123 | p.mu.Unlock() |
| 124 | return |
| 125 | } |
| 126 | p.running = false |
| 127 | close(p.stopCh) |
| 128 | p.mu.Unlock() |
| 129 | |
| 130 | p.wg.Wait() |
| 131 | logrus.Info("Lineage outbox processor stopped") |
| 132 | } |
| 133 | |
| 134 | // IsRunning returns whether the processor is currently running. |
| 135 | // |