MCPcopy Create free account
hub / github.com/EasyIME/PIME / handleRequest

Method handleRequest

python/server.py:43–58  ·  view source on GitHub ↗
(self, msg)

Source from the content-addressed store, hash-verified

41 return (self.service is not None)
42
43 def handleRequest(self, msg): # msg is a json object
44 method = msg.get("method")
45 seqNum = msg.get("seqNum", 0)
46 # print("handle message: ", str(id(self)), method, seqNum)
47 service = self.service
48 if service:
49 # let the text service handle the message
50 reply = service.handleRequest(msg)
51 else: # the text service is not yet initialized
52 reply = {"seqNum": seqNum}
53 success = False
54 if method == "init": # initialize the text service
55 success = self.init(msg)
56 reply["success"] = success
57 # print(reply)
58 return reply
59
60
61class Server(object):

Callers 1

runMethod · 0.95

Calls 2

initMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected