Class: EventMachine::Selectable
- Inherits:
-
Object
- Object
- EventMachine::Selectable
show all
- Defined in:
- lib/pr_eventmachine.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of Selectable.
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
|
# File 'lib/pr_eventmachine.rb', line 447
def initialize io
@uuid = UuidGenerator.generate
@io = io
@last_activity = Reactor.instance.current_loop_time
if defined?(Fcntl::F_GETFL)
m = @io.fcntl(Fcntl::F_GETFL, 0)
@io.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK | m)
else
begin
s = Socket.for_fd(@io.fileno)
s.fcntl( Fcntl::F_SETFL, Fcntl::O_NONBLOCK )
rescue Errno::EINVAL, Errno::EBADF
STDERR.puts "Serious error: unable to set descriptor non-blocking"
end
end
@close_scheduled = false
@close_requested = false
se = self; @io.instance_eval { @my_selectable = se }
Reactor.instance.add_selectable @io
end
|
Instance Attribute Details
#io ⇒ Object
Returns the value of attribute io.
445
446
447
|
# File 'lib/pr_eventmachine.rb', line 445
def io
@io
end
|
#uuid ⇒ Object
Returns the value of attribute uuid.
445
446
447
|
# File 'lib/pr_eventmachine.rb', line 445
def uuid
@uuid
end
|
Instance Method Details
#close_scheduled? ⇒ Boolean
474
475
476
|
# File 'lib/pr_eventmachine.rb', line 474
def close_scheduled?
@close_scheduled
end
|
#get_peername ⇒ Object
486
487
488
|
# File 'lib/pr_eventmachine.rb', line 486
def get_peername
nil
end
|
#heartbeat ⇒ Object
494
495
|
# File 'lib/pr_eventmachine.rb', line 494
def heartbeat
end
|
#select_for_reading? ⇒ Boolean
478
479
480
|
# File 'lib/pr_eventmachine.rb', line 478
def select_for_reading?
false
end
|
#select_for_writing? ⇒ Boolean
482
483
484
|
# File 'lib/pr_eventmachine.rb', line 482
def select_for_writing?
false
end
|
#set_inactivity_timeout(tm) ⇒ Object
490
491
492
|
# File 'lib/pr_eventmachine.rb', line 490
def set_inactivity_timeout tm
@inactivity_timeout = tm
end
|