12d7327999fd359419f64f75c73ae7e5c8f56a42,service/server.py,BertServer,run,#BertServer#,46

Before Change


            // check if there are finished jobs, send it back to workers
            finished = [(k, v) for k, v in finish_jobs.items() if len(v) == job_checksum[k]]
            for client, tmp in finished:
                for k in tmp:
                    print(k)
                self.frontend.send_multipart([client, b"", pickle.dumps(np.concatenate(tmp, axis=0), protocol=-1)])
                unregister_job(client)

            // non-empty job queue and free workers, pop the last one and send it to a worker

After Change


                free_a_worker(worker)
                if client != b"READY" and len(request) > 3:
                    _, reply = request[3:]
                    X = np.frombuffer(memoryview(reply), dtype=md["dtype"])
                    finish_jobs[client].append(X.reshape(md["shape"]))
                else:
                    poller.register(self.frontend, zmq.POLLIN)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: hanxiao/bert-as-service
Commit Name: 12d7327999fd359419f64f75c73ae7e5c8f56a42
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: b274db161929f34024c254dc5b78603abbeb855a
Time: 2018-11-15
Author: hanhxiao@tencent.com
File Name: service/server.py
Class Name: BertSink
Method Name: run


Project Name: hanxiao/bert-as-service
Commit Name: 9db1c1d7060f26f3d871d72d5a5690c073d67ade
Time: 2018-11-14
Author: hanhxiao@tencent.com
File Name: service/server.py
Class Name: BertServer
Method Name: run