Commit d09b80f2 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 1c39bd22
...@@ -271,8 +271,8 @@ func (e encoding) Tuple(t tuple) interface{} { ...@@ -271,8 +271,8 @@ func (e encoding) Tuple(t tuple) interface{} {
case 'M': case 'M':
// msgpack: -> leave as tuple // msgpack: -> leave as tuple
// However shamaton/msgpack encodes tuple(nil) as nil, not empty tuple // However shamaton/msgpack encodes tuple(nil) as nil, not empty tuple,
// so nil -> tuple{} // so nil -> tuple{}.
if t == nil { if t == nil {
t = tuple{} t = tuple{}
} }
......
...@@ -92,6 +92,10 @@ func (zl *zLink) start() { ...@@ -92,6 +92,10 @@ func (zl *zLink) start() {
// XXX it would be better for zLink to instead provide .Recv() to receive // XXX it would be better for zLink to instead provide .Recv() to receive
// peer's requests and then serve is just loop over Recv and decide what to do // peer's requests and then serve is just loop over Recv and decide what to do
// with messages. // with messages.
//
// XXX -> Serve(notifyTab, serveTab) error
// XXX err = nil on normal zlink.Close
// XXX err != nil on zlink.shutdown(err)
func (zl *zLink) StartServe( func (zl *zLink) StartServe(
notifyTab map[string]func(interface{}) error, notifyTab map[string]func(interface{}) error,
serveTab map[string]func(context.Context, interface{}) interface{}, serveTab map[string]func(context.Context, interface{}) interface{},
...@@ -126,6 +130,8 @@ func (zl *zLink) shutdown(err error) { ...@@ -126,6 +130,8 @@ func (zl *zLink) shutdown(err error) {
// XXX if err != nil -> watchq <- zodb.EventError{err} // XXX if err != nil -> watchq <- zodb.EventError{err}
// XXX close watcher // XXX close watcher
// XXX -> notifyTab.shutdown?
// XXX -> go Serve() -> err -> watchq? <- yes
}) })
} }
...@@ -279,6 +285,7 @@ func (zl *zLink) Call(ctx context.Context, method string, argv ...interface{}) ( ...@@ -279,6 +285,7 @@ func (zl *zLink) Call(ctx context.Context, method string, argv ...interface{}) (
return reply, nil return reply, nil
} }
// reply sends reply to a call received with msgid.
func (zl *zLink) reply(msgid int64, res interface{}) (err error) { func (zl *zLink) reply(msgid int64, res interface{}) (err error) {
defer func() { defer func() {
if err != nil { if err != nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment