我正在玩zk客户端(https://github.com/zk-ruby/zk) 但是当我创建客户端并执行get操作时,我偶尔会看到连接丢失:
[3] pry(main)> zk = ZK::Client::Threaded.new('localhost:2181')
=> #<ZK::Client::Threaded:70121951431300 zk_session_id=0x1440e09ba110007 ...>
[4] pry(main)> zk.get("/")
=> ["",
#<Zookeeper::Stat:0x007f8d151ed1c0
... ]
[5] pry(main)> zk.get("/")
Zookeeper::Exceptions::NotConnected: the connection is shutting down
from /usr/local/var/rbenv/versions/1.9.2-p180/lib/ruby/gems/1.9.1/gems/zookeeper- 1.4.8/lib/zookeeper/continuation.rb:124:in `block in value'
有人可以指点我可以了解连接管理语义的指南吗?