Engine: integer job status, improved stream API

* Jobs return an integer status instead of a string
* Status convention mimics unix process execution: 0=success, 1=generic error, 127="no such command"
* Stdout and Stderr support multiple thread-safe data receivers and ring buffer filtering
This commit is contained in:
Solomon Hykes
2013-11-30 00:25:46 +00:00
parent 82cecb34b5
commit a4f8a2494b
12 changed files with 290 additions and 154 deletions
+4 -3
View File
@@ -38,8 +38,9 @@ func TestJob(t *testing.T) {
t.Fatalf("job1.handler should be empty")
}
h := func(j *Job) string {
return j.Name
h := func(j *Job) Status {
j.Printf("%s\n", j.Name)
return 42
}
eng.Register("dummy2", h)
@@ -49,7 +50,7 @@ func TestJob(t *testing.T) {
t.Fatalf("job2.handler shouldn't be nil")
}
if job2.handler(job2) != job2.Name {
if job2.handler(job2) != 42 {
t.Fatalf("handler dummy2 was not found in job2")
}
}