Browse files

tweaks on gen_server package: Reply is now a method of CallMessage

  • Loading branch information...
1 parent a596536 commit b962502087ce2b188fd21409f79aee3583093ef7 @rpl committed Oct 4, 2011
Showing with 3 additions and 3 deletions.
  1. +1 −1 pkg/gen_server/gen_server_test.go
  2. +2 −2 pkg/gen_server/methods.go
View
2 pkg/gen_server/gen_server_test.go
@@ -44,7 +44,7 @@ func (self *TestServer) HandleCast(msg *CastMessage) {
func (self *TestServer) HandleCall(msg *CallMessage) {
self.log("HANDLE CALL ", msg)
- self.GenServer.Reply(msg, true, "WORLD")
+ msg.Reply(true, "WORLD")
self.log("MESSAGE SENT ", msg)
}
View
4 pkg/gen_server/methods.go
@@ -109,7 +109,7 @@ func (self *GenServer) Call(name string, args Data) ReplyMessage {
return <- reply_ch
}
-func (self *GenServer) Reply(rcv_msg *CallMessage, ok bool, result Data) {
- rcv_msg.ReplyChannel <- ReplyMessage{Ok: ok, Result: result}
+func (self *CallMessage) Reply(ok bool, result Data) {
+ self.ReplyChannel <- ReplyMessage{Ok: ok, Result: result}
}

0 comments on commit b962502

Please sign in to comment.