summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2012-04-09 09:07:19 +0200
committerYorhel <git@yorhel.nl>2012-04-09 09:07:19 +0200
commit89cb48caf91a8abe6d483e85e94bc18a64926855 (patch)
treed8a9251a0f0d1c11e84d4909a293539e79db67c6
parent1849ccbbc46fbcc57abaa150a691c80a3bd4a668 (diff)
(Re-)added public API that accepts Tuple arguments
Sometimes you do need them...
-rw-r--r--msg.go4
-rw-r--r--rpc.go2
-rw-r--r--ses.go12
3 files changed, 13 insertions, 5 deletions
diff --git a/msg.go b/msg.go
index 9c30abc..2f09c35 100644
--- a/msg.go
+++ b/msg.go
@@ -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...))
}
diff --git a/rpc.go b/rpc.go
index a31fdc3..5501df7 100644
--- a/rpc.go
+++ b/rpc.go
@@ -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
diff --git a/ses.go b/ses.go
index 537b1a4..8af07dd 100644
--- a/ses.go
+++ b/ses.go
@@ -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...))
+}