模块 Timeout

Timeout 用于长时间运行的代码块

概要

require 'timeout'
status = Timeout.timeout(5) {
  # Something that should be interrupted if it takes more than 5 seconds...
}

描述

Timeout 提供了一种方法,可以在操作在固定时间内未完成时自动终止潜在的长时间运行操作。

版权

© 2000 Network Applied Communication Laboratory, Inc.

版权

© 2000 Information-technology Promotion Agency, Japan