rpc/servlet_handler.go
crusader c0fdabe039 ing
2017-11-29 01:24:16 +09:00

26 lines
939 B
Go

package rpc
import (
"git.loafle.net/commons_go/rpc/protocol"
cuc "git.loafle.net/commons_go/util/context"
)
type ServletHandler interface {
ServletContext(parent cuc.Context) ServletContext
Init(servletCTX ServletContext) error
ReadRequest(servletCTX ServletContext, codec protocol.ServerCodec, conn interface{}) (protocol.ServerRequestCodec, error)
Invoke(servletCTX ServletContext, requestCodec protocol.RegistryCodec) (result interface{}, err error)
WriteResponse(servletCTX ServletContext, conn interface{}, requestCodec protocol.ServerRequestCodec, result interface{}, err error) error
WriteNotification(servletCTX ServletContext, conn interface{}, codec protocol.ServerCodec, method string, args []interface{}) error
Destroy(servletCTX ServletContext)
RegisterCodec(contentType string, codec protocol.ServerCodec)
getCodec(contentType string) (protocol.ServerCodec, error)
GetPendingResponses() int
Validate()
}