Remove extra goroutine wrapper in task.go

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
Signed-off-by: Solomon Hykes <solomon@docker.com>
This commit is contained in:
Aanand Prasad 2014-06-04 13:25:03 -07:00 committed by Solomon Hykes
parent af2c34b3b5
commit 75b1e228cc
1 changed files with 3 additions and 6 deletions

View File

@ -13,12 +13,9 @@ func Task(f func(in Receiver, out Sender)) Sender {
obj := NewServer()
obj.OnAttach(Handler(func(msg *Message) error {
msg.Ret.Send(&Message{Name: "ack", Ret: inW})
go func() {
fmt.Printf("copying task output from %#v to %#v\n", outR, msg.Ret)
defer fmt.Printf("(DONE) copying task output from %#v to %#v\n", outR, msg.Ret)
Copy(msg.Ret, outR)
msg.Ret.Close()
}()
return nil
}))
obj.OnStart(Handler(func(msg *Message) error {