-
Notifications
You must be signed in to change notification settings - Fork 21
/
redistributor.go
39 lines (36 loc) · 1.09 KB
/
redistributor.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package worker
import (
// "fmt"
"github.com/MG-RAST/AWE/lib/core"
// "github.com/MG-RAST/AWE/lib/logger"
// "github.com/MG-RAST/AWE/lib/logger/event"
)
// func redistributor(control chan int) {
// fmt.Printf("redistributor launched, client=%s\n", core.Self.Id)
// defer fmt.Printf("redistributor exiting...\n")
// for {
// parsed := <-FromStealer
// work := parsed.Workunit
//
// workmap.Set(work.Id, ID_REDISTRIBUTOR, "redistributor")
//
// queued := &Mediumwork{
// Workunit: parsed.Workunit,
// Perfstat: parsed.Perfstat,
// }
//
// if err := SubmitWorkProxy(work); err != nil {
// fmt.Printf("SubmitWorkProxy() returned error: %s\n", err.Error())
// logger.Error("SubmitWorkProxy(): workid=" + work.Id + ", " + err.Error())
// queued.Workunit.SetState(core.WORK_STAT_ERROR)
// } else {
// queued.Workunit.SetState(core.WORK_STAT_PROXYQUEUED)
// logger.Event(event.WORK_QUEUED, "workid="+work.Id)
// }
// }
// control <- ID_REDISTRIBUTOR //we are ending
// }
func SubmitWorkProxy(work *core.Workunit) (err error) {
err = core.QMgr.EnqueueWorkunit(work)
return
}