diff options
-rw-r--r-- | msg.go | 4 | ||||
-rw-r--r-- | rpc.go | 2 | ||||
-rw-r--r-- | ses.go | 12 |
3 files changed, 13 insertions, 5 deletions
@@ -28,6 +28,10 @@ func (m *Message) Dispatch() { } } +func (m *Message) Replyt(t Tuple) { + m.ret.reply(t) +} + func (m *Message) Reply(t ...interface{}) { m.ret.reply(Tup(t...)) } @@ -62,7 +62,7 @@ func (s *Session) RegRPC(obj interface{}, f func(string) Tuple) int { pat = append(pat, El(nil)) } // Generate callback and register - s.register(willReply, pat).Callback(regRPCGenCallback(mt, mv, offset, willReply)) + s.Registert(willReply, pat).Callback(regRPCGenCallback(mt, mv, offset, willReply)) num++ } return num @@ -79,7 +79,7 @@ func (n *Node) Session() *Session { return s } -func (s *Session) register(willReply bool, p Tuple) *Registration { +func (s *Session) Registert(willReply bool, p Tuple) *Registration { r := &Registration{} r.recv = s r.pat = p @@ -88,7 +88,7 @@ func (s *Session) register(willReply bool, p Tuple) *Registration { } func (s *Session) Register(willReply bool, p ...interface{}) *Registration { - return s.register(willReply, Tup(p...)) + return s.Registert(willReply, Tup(p...)) } func (s *Session) Close() { @@ -143,14 +143,18 @@ func (s *Session) Run() { } } -func (s *Session) Send(wantReply bool, t ...interface{}) *ReturnPath { +func (s *Session) Sendt(wantReply bool, t Tuple) *ReturnPath { s.node.lock.Lock() var r *ReturnPath if wantReply { r = newReturnPathSession(s) s.rets[r] = true } - s.node.send(Tup(t...), r, nil) + s.node.send(t, r, nil) s.node.lock.Unlock() return r } + +func (s *Session) Send(wantReply bool, t ...interface{}) *ReturnPath { + return s.Sendt(wantReply, Tup(t...)) +} |