Class: EventMachine::Selectable

Inherits:
Object
  • Object
show all
Defined in:
lib/pr_eventmachine.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ Selectable

Returns a new instance of Selectable.



316
317
318
319
320
321
322
323
324
325
326
327
328
329
# File 'lib/pr_eventmachine.rb', line 316

def initialize io
  @uuid = UuidGenerator.generate
  @io = io

  m = @io.fcntl(Fcntl::F_GETFL, 0)
  @io.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK | m)
  # TODO, should set CLOEXEC on Unix?

  @close_scheduled = false
  @close_requested = false

  se = self; @io.instance_eval { @my_selectable = se }
  Reactor.instance.add_selectable @io
end

Instance Attribute Details

#ioObject (readonly)

Returns the value of attribute io.



314
315
316
# File 'lib/pr_eventmachine.rb', line 314

def io
  @io
end

#uuidObject (readonly)

Returns the value of attribute uuid.



314
315
316
# File 'lib/pr_eventmachine.rb', line 314

def uuid
  @uuid
end

Instance Method Details

#close_scheduled?Boolean

Returns:

  • (Boolean)


331
332
333
# File 'lib/pr_eventmachine.rb', line 331

def close_scheduled?
  @close_scheduled
end

#get_peernameObject



343
344
345
# File 'lib/pr_eventmachine.rb', line 343

def get_peername
  nil
end

#select_for_reading?Boolean

Returns:

  • (Boolean)


335
336
337
# File 'lib/pr_eventmachine.rb', line 335

def select_for_reading?
  false
end

#select_for_writing?Boolean

Returns:

  • (Boolean)


339
340
341
# File 'lib/pr_eventmachine.rb', line 339

def select_for_writing?
  false
end