mirror of https://github.com/docker/docs.git
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:
parent
af2c34b3b5
commit
75b1e228cc
|
@ -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()
|
||||
}()
|
||||
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)
|
||||
return nil
|
||||
}))
|
||||
obj.OnStart(Handler(func(msg *Message) error {
|
||||
|
|
Loading…
Reference in New Issue