擅长:python、mysql、java
<p>我正在使用“zerorpc”:“^0.9.3”
我在运行一个耗时的python代码时遇到了同样的问题。解决这个问题的方法是需要修改zerorpc的库代码:
节点\模块->零RPC->库->;频道.js
将协同响应方法更改为</p>
<pre><code>//Runs the heartbeat on this channel
Channel.prototype._runHeartbeat = function() {
var self = this;
return setInterval(function() {
if(util.curTime() > self._heartbeatExpirationTime) {
//If we haven't received a response in 2 * heartbeat rate, send an
//error
// self.emit("heartbeat-error", "Lost remote after " + (HEARTBEAT * 2) + "ms");
// self.close();
}
//Heartbeat on the channel
try {
var event = events.create(self._envelope, self._createHeader(), "_zpc_hb", [0]);
self._socket.send(event);
} catch(e) {
console.error("Error occurred while sending heartbeat:", e);
}
}, HEARTBEAT);
};
</code></pre>
<p>在github的最新代码中:<a href="https://github.com/dotcloud/zerorpc-node" rel="nofollow">https://github.com/dotcloud/zerorpc-node</a>
他们已经解决了这个问题。在</p>