Pause pauses the loop for a specific PRD (stops after current iteration).
(name string)
| 336 | |
| 337 | // Pause pauses the loop for a specific PRD (stops after current iteration). |
| 338 | func (m *Manager) Pause(name string) error { |
| 339 | m.mu.RLock() |
| 340 | instance, exists := m.instances[name] |
| 341 | m.mu.RUnlock() |
| 342 | |
| 343 | if !exists { |
| 344 | return fmt.Errorf("PRD %s not found", name) |
| 345 | } |
| 346 | |
| 347 | instance.mu.Lock() |
| 348 | defer instance.mu.Unlock() |
| 349 | |
| 350 | if instance.State != LoopStateRunning { |
| 351 | return fmt.Errorf("PRD %s is not running", name) |
| 352 | } |
| 353 | |
| 354 | if instance.Loop != nil { |
| 355 | instance.Loop.Pause() |
| 356 | } |
| 357 | |
| 358 | return nil |
| 359 | } |
| 360 | |
| 361 | // Stop stops the loop for a specific PRD immediately. |
| 362 | func (m *Manager) Stop(name string) error { |
no outgoing calls