Method: Async::Wrapper#initialize

Defined in:
lib/async/wrapper.rb

#initialize(io, reactor = nil) ⇒ Wrapper

Returns a new instance of Wrapper.

Parameters:

  • io

    the native object to wrap.

  • reactor (Reactor) (defaults to: nil)

    the reactor that is managing this wrapper, or not specified, it's looked up by way of Task.current.



41
42
43
44
45
46
47
48
49
50
# File 'lib/async/wrapper.rb', line 41

def initialize(io, reactor = nil)
  @io = io
  
  @reactor = reactor
  @monitor = nil
  
  @readable = nil
  @writable = nil
  @any = nil
end