Skip to content

Commit

Permalink
Revert "Delegate requests to separate goroutines"
Browse files Browse the repository at this point in the history
This reverts commit f3d6c32.
  • Loading branch information
vibhavp committed Mar 10, 2016
1 parent f3d6c32 commit 935bfd9
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,19 @@ func (c *Client) listener(s *Server) {
}

s.Requests.Add(1)
go func() {
reply := s.getReply()
reply.ID = req.ID
if defaultHandler {
reply.Data, err = s.call(c, f, []byte("{}"))
} else {
reply.Data, err = s.call(c, f, req.Data)
}
if err != nil {
reply.Data = s.codec.Error(err)
}
s.Requests.Done()
reply := s.getReply()
reply.ID = req.ID
if defaultHandler {
reply.Data, err = s.call(c, f, []byte("{}"))
} else {
reply.Data, err = s.call(c, f, req.Data)
}
if err != nil {
reply.Data = s.codec.Error(err)
}
s.Requests.Done()

go func() {
bytes, _ := json.Marshal(reply)

c.Emit(string(bytes))
Expand Down

0 comments on commit 935bfd9

Please sign in to comment.