lib/async/debug/monitor.rb in async-1.28.9 vs lib/async/debug/monitor.rb in async-1.29.0
- old
+ new
@@ -18,28 +18,26 @@
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
+require 'delegate'
+
module Async
module Debug
- class Monitor
+ class Monitor < Delegator
def initialize(monitor, selector)
@monitor = monitor
@selector = selector
end
- def close
- @selector.deregister(@monitor.io)
- @monitor.close
+ def __getobj__
+ @monitor
end
- def method_missing(*arguments, &block)
- @monitor.send(*arguments)
- end
-
- def respond_to?(*arguments)
- @monitor.respond_to?(*arguments)
+ def close
+ @selector.deregister(self)
+ @monitor.close
end
def inspect
"\#<#{self.class} io=#{@monitor.io.inspect} interests=#{@monitor.interests.inspect} readiness=#{@monitor.readiness.inspect}>"
end