Err returns nil if the task loop is still running. Otherwise it return errClosed if the loop has been closed/stopped.
()
| 104 | // Err returns nil if the task loop is still running. |
| 105 | // Otherwise it return errClosed if the loop has been closed/stopped. |
| 106 | func (l *Loop) Err() error { |
| 107 | select { |
| 108 | case <-l.done: |
| 109 | return ErrClosed |
| 110 | default: |
| 111 | return nil |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | // Deadline returns the no valid time as task loops have no deadline. |
| 116 | func (l *Loop) Deadline() (deadline time.Time, ok bool) { |