RemainingTask returns a Task representing the remaining work, or nil if complete
()
| 48 | |
| 49 | // RemainingTask returns a Task representing the remaining work, or nil if complete |
| 50 | func (at *ActiveTask) RemainingTask() *types.Task { |
| 51 | current := at.CurrentOffset.Load() |
| 52 | stopAt := at.StopAt.Load() |
| 53 | if current >= stopAt { |
| 54 | return nil |
| 55 | } |
| 56 | return &types.Task{Offset: current, Length: stopAt - current} |
| 57 | } |
| 58 | |
| 59 | // GetSpeed returns the current EMA-smoothed speed, decaying if stalled |
| 60 | func (at *ActiveTask) GetSpeed() float64 { |
no outgoing calls