Record deadline within WorkerInfo

This commit is contained in:
Ken Hibino
2021-01-27 15:55:43 -08:00
parent bfde0b6283
commit eba7c4e085
9 changed files with 40 additions and 30 deletions

View File

@@ -63,7 +63,7 @@ type processor struct {
// cancelations is a set of cancel functions for all active tasks.
cancelations *base.Cancelations
starting chan<- *base.TaskMessage
starting chan<- *workerInfo
finished chan<- *base.TaskMessage
}
@@ -78,7 +78,7 @@ type processorParams struct {
strictPriority bool
errHandler ErrorHandler
shutdownTimeout time.Duration
starting chan<- *base.TaskMessage
starting chan<- *workerInfo
finished chan<- *base.TaskMessage
}
@@ -180,7 +180,7 @@ func (p *processor) exec() {
return
}
p.starting <- msg
p.starting <- &workerInfo{msg, time.Now(), deadline}
go func() {
defer func() {
p.finished <- msg