capnproto / go-capnp

Cap'n Proto library and code generator for Go

Home Page:https://capnproto.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cleanup: tease apart method lookup & server processing.

zenhack opened this issue · comments

Per discussion in #400 and #405, it would be nice to refactor the sever package a bit, so that method handling is encapsulated in an interface like:

type MethodHandler interface {
    HandleMethod(context.Context, capnp.Method, *Call)
}

...and looking up the particular method in a slice or whatnot is an implementation detail of serverMethods's implementation of HandleMethod(). Low priority, since it's mostly a cleanup thing, but I'd like to do this before we tag 3.0 and thus can't make breaking changes.