Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法限制与 ruby Net/SFTP库的传输连接?我想利用它每晚下载一些备份,但不想在这样做时耗尽服务器的所有带宽。
考虑 Net::SFTP 文档中的这个示例:
# open and read from a pseudo-IO for a remote file sftp.file.open("/path/to/remote", "r") do |f| puts f.gets end
如果你sleep在那个块里面放一个会发生什么?
sleep