mirror of
https://github.com/minio/minio.git
synced 2026-11-24 23:20:49 +00:00
Make priority queue lambda function return error over a channel
This commit is contained in:
1 parent
38a6ce36e5
commit
0533abf6a8
9 files changed
+34
-14
No files matched your search
@@ -18,7 +18,7 @@ package pq
|
||||
|
||||
// Task container for any generic tasks
|
||||
type Task struct {
|
||||
job func() error
|
||||
job func() <-chan error
|
||||
priority int
|
||||
}
|
||||
|
||||
@@ -34,5 +34,5 @@ func (t Task) UpdatePriority(p int) {
|
||||
|
||||
// Execute execute current task
|
||||
func (t Task) Execute() error {
|
||||
return t.job()
|
||||
return <-t.job()
|
||||
}
|
||||
Reference in new issue
Block a user