Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit b962502087ce2b188fd21409f79aee3583093ef7 1 parent a596536
@rpl authored
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}
}
Please sign in to comment.
Something went wrong with that request. Please try again.