2017-06-14 21:55:50 +00:00
|
|
|
package log
|
|
|
|
|
|
|
|
// Task is an interface which encapsulates an activity which can be logged.
|
|
|
|
type Task interface {
|
|
|
|
// Updates returns a channel which is written to with the current state
|
|
|
|
// of the Task when an update is present. It is closed when the task is
|
|
|
|
// complete.
|
|
|
|
Updates() <-chan string
|
2017-06-16 20:42:43 +00:00
|
|
|
|
2017-06-19 20:19:19 +00:00
|
|
|
// Throttled returns whether or not updates from this task should be
|
|
|
|
// limited when being printed to a sink via *log.Logger.
|
2017-06-16 20:42:43 +00:00
|
|
|
//
|
|
|
|
// It is expected to return the same value for a given Task instance.
|
2017-06-19 20:19:19 +00:00
|
|
|
Throttled() bool
|
2017-06-16 20:42:43 +00:00
|
|
|
}
|