Make priority queue lambda function return error over a channel

This commit is contained in:
Harshavardhana committed 2015-07-02 21:04:04 -07:00
1 parent 38a6ce36e5
commit 0533abf6a8
9 files changed
+34 -14

No files matched your search

+2 -2
View File
@@ -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()
}