815601e47f97acb3d00633d5ff172403c76bf034,service/server.py,BertServer,run,#BertServer#,47
Before Change
request = self.backend.recv_multipart()
worker, _, client = request[:3]
// parsing data size
md = json.loads(request[-1])
// receiving actual data
request = self.backend.recv_multipart()
worker, _, client = request[:3]
free_a_worker(worker)
_, reply = request[3:]
X = np.frombuffer(memoryview(reply), dtype=md["dtype"])
finish_jobs[client].append(X.reshape(md["shape"]))
if self.frontend in sockets:
// Get next client request, route to last-used worker
After Change
free_a_worker(worker)
if client != b"READY" and len(request) > 3:
_, reply = request[3:]
finish_jobs[client].append(pickle.loads(reply))
else:
poller.register(self.frontend, zmq.POLLIN)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 12
Instances
Project Name: hanxiao/bert-as-service
Commit Name: 815601e47f97acb3d00633d5ff172403c76bf034
Time: 2018-11-13
Author: hanhxiao@tencent.com
File Name: service/server.py
Class Name: BertServer
Method Name: run
Project Name: hanxiao/bert-as-service
Commit Name: 56ee77adc33f1fe94341344bc6ef8089fd8f00b8
Time: 2018-11-13
Author: hanhxiao@tencent.com
File Name: service/server.py
Class Name: BertServer
Method Name: run
Project Name: hanxiao/bert-as-service
Commit Name: 72ba607dc22f1cf0f071acf90756bfb0c4a2c068
Time: 2018-11-13
Author: hanhxiao@tencent.com
File Name: service/server.py
Class Name: BertServer
Method Name: run