GetState returns the state of a specific PRD loop.
(name string)
| 429 | |
| 430 | // GetState returns the state of a specific PRD loop. |
| 431 | func (m *Manager) GetState(name string) (LoopState, int, error) { |
| 432 | m.mu.RLock() |
| 433 | instance, exists := m.instances[name] |
| 434 | m.mu.RUnlock() |
| 435 | |
| 436 | if !exists { |
| 437 | return LoopStateReady, 0, fmt.Errorf("PRD %s not found", name) |
| 438 | } |
| 439 | |
| 440 | instance.mu.Lock() |
| 441 | defer instance.mu.Unlock() |
| 442 | |
| 443 | return instance.State, instance.Iteration, instance.Error |
| 444 | } |
| 445 | |
| 446 | // GetInstance returns a copy of the loop instance data for a specific PRD. |
| 447 | func (m *Manager) GetInstance(name string) *LoopInstance { |
no outgoing calls