function _M.watch_receive()

in lib/shenyu/register/zookeeper/zk_client.lua [184:201]


function _M.watch_receive(self)
    local last_time = 0
    while true do
        if exiting() then
            self.conn.close()
            return true
        end
        local can_ping = now() - last_time > self.ping_time
        if can_ping then
            local ok, err = reply_read(self)
            if err then
                return nil, err
            end
            last_time = now()
        end
        sleep(0.2)
    end
end