newHandoffWorkerManager creates a new handoff worker manager
(config *Config, poolHook *PoolHook)
| 45 | |
| 46 | // newHandoffWorkerManager creates a new handoff worker manager |
| 47 | func newHandoffWorkerManager(config *Config, poolHook *PoolHook) *handoffWorkerManager { |
| 48 | return &handoffWorkerManager{ |
| 49 | handoffQueue: make(chan HandoffRequest, config.HandoffQueueSize), |
| 50 | shutdown: make(chan struct{}), |
| 51 | maxWorkers: config.MaxWorkers, |
| 52 | activeWorkers: atomic.Int32{}, // Start with no workers - create on demand |
| 53 | workerTimeout: 15 * time.Second, // Workers exit after 15s of inactivity |
| 54 | config: config, |
| 55 | poolHook: poolHook, |
| 56 | circuitBreakerManager: newCircuitBreakerManager(config), |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | // getCurrentWorkers returns the current number of active workers (for testing) |
| 61 | func (hwm *handoffWorkerManager) getCurrentWorkers() int { |
no test coverage detected