对于最新的js zerorpc版本v0.9.8
:
# npm list zerorpc
xxx/electron-python-example
└── zerorpc@0.9.8
和最新的 python zerorpc版本v0.6.3
# pip show zerorpc
Name: zerorpc
Version: 0.6.3
Summary: zerorpc is a flexible RPC based on zeromq.
Home-page: https://github.com/0rpc/zerorpc-python
Author: François-Xavier Bourlet <bombela+zerorpc@gmail.com>.
Author-email: UNKNOWN
License: MIT
Location: xxx/venv/lib/python3.8/site-packages
Requires: msgpack, future, pyzmq, gevent
Required-by:
哪个提供你已经说过的heartbeatInterval
。
所以我在这里使用代码electron-python-example/renderer.js
:
const constLargeEnoughHeartbeat = 60 * 60 * 24 * 30 * 12 // 1 Year
clientOptions = {
"heartbeatInterval": constLargeEnoughHeartbeat,
}
let client = new zerorpc.Client(clientOptions)
可以实现你期望的:大到1年心跳->超过10s,js和python还在运行,不再报错
- js:
invoke startSaver: error=Error: Lost remote after 10000ms
- Python:
zerorpc.exceptions.LostRemote: Lost remote after 10s heartbeat