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