()
| 135 | } |
| 136 | |
| 137 | func (executor *SimpleTaskExecutor) Shutdown() chan bool { |
| 138 | executor.executorMu.Lock() |
| 139 | defer executor.executorMu.Unlock() |
| 140 | |
| 141 | if executor.isShutdown { |
| 142 | panic("executor is already shut down") |
| 143 | } |
| 144 | |
| 145 | executor.isShutdown = true |
| 146 | |
| 147 | stoppedChan := make(chan bool) |
| 148 | executor.shutdownChannel <- stoppedChan |
| 149 | return stoppedChan |
| 150 | } |
| 151 | |
| 152 | func (executor *SimpleTaskExecutor) calculateTriggerTime(delay time.Duration) time.Time { |
| 153 | if delay < 0 { |
no outgoing calls