真是费了我九牛二虎之力,终于搞定
网上有说如下方式获取的
class
CustomTProcessor(TProcessor):
def
process_in(
self
, iprot):
api, type, seqid = iprot.read_message_begin()
if
api
not in
self
._service.thrift_services:
iprot.skip(TType.STRUCT)
iprot.read_message_end()
return
api, seqid, TApplicationException(TApplicationException.UNKNOWN_METHOD),
None
# noqa
args =
getattr
(
self
._service, api +
"_args"
)()
args.read(iprot)
iprot.read_message_end()
result =
getattr
(
self
._service, api +
"_result"
)()
# convert kwargs to args
api_args = [args.thrift_spec[k][
1
]
for
k
in
sorted
(args.thrift_spec)]
# get client IP address
client_ip, client_port = iprot.trans.sock.getpeername()
def
call
():
f =
getattr
(self._handler, api)