simplify task execution

This commit is contained in:
Darien Raymond
2018-12-06 11:35:02 +01:00
parent cf1705267e
commit 427679e66d
15 changed files with 46 additions and 154 deletions
+2 -2
View File
@@ -64,7 +64,7 @@ func (server *Server) handleConnection(conn net.Conn) {
}
pReader, pWriter := pipe.New(pipe.WithoutSizeLimit())
err := task.Run(task.Parallel(func() error {
err := task.Run(context.Background(), func() error {
defer pWriter.Close() // nolint: errcheck
for {
@@ -96,7 +96,7 @@ func (server *Server) handleConnection(conn net.Conn) {
return err
}
}
}))()
})
if err != nil {
fmt.Println("failed to transfer data: ", err.Error())