about summary refs log tree commit homepage
path: root/lib/rainbows/fiber/io/compat.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rainbows/fiber/io/compat.rb')
-rw-r--r--lib/rainbows/fiber/io/compat.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/rainbows/fiber/io/compat.rb b/lib/rainbows/fiber/io/compat.rb
new file mode 100644
index 0000000..2aaf416
--- /dev/null
+++ b/lib/rainbows/fiber/io/compat.rb
@@ -0,0 +1,10 @@
+# -*- encoding: binary -*-
+module Rainbows::Fiber::IO::Compat
+  def initialize(io, fiber = Fiber.current)
+    @to_io, @f = io, fiber
+  end
+
+  def close
+    @to_io.close
+  end
+end