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.



327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'lib/pr_eventmachine.rb', line 327

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.



325
326
327
# File 'lib/pr_eventmachine.rb', line 325

def io
  @io
end

#uuidObject (readonly)

Returns the value of attribute uuid.



325
326
327
# File 'lib/pr_eventmachine.rb', line 325

def uuid
  @uuid
end

Instance Method Details

#close_scheduled?Boolean

Returns:

  • (Boolean)


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

def close_scheduled?
  @close_scheduled
end

#get_peernameObject



354
355
356
# File 'lib/pr_eventmachine.rb', line 354

def get_peername
  nil
end

#select_for_reading?Boolean

Returns:

  • (Boolean)


346
347
348
# File 'lib/pr_eventmachine.rb', line 346

def select_for_reading?
  false
end

#select_for_writing?Boolean

Returns:

  • (Boolean)


350
351
352
# File 'lib/pr_eventmachine.rb', line 350

def select_for_writing?
  false
end