stop signals the worker to stop.
()
| 79 | |
| 80 | // stop signals the worker to stop. |
| 81 | func (mw *memoryWorker) stop() { |
| 82 | select { |
| 83 | case <-mw.stopCh: |
| 84 | // already closed |
| 85 | default: |
| 86 | close(mw.stopCh) |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | // nudge is called after each LLM response to check if memory extraction should run. |
| 91 | // It runs in a goroutine — non-blocking to the main flow. |