Class: EventMachine::Selectable
- Inherits:
-
Object
- Object
- EventMachine::Selectable
- Defined in:
- lib/pr_eventmachine.rb
Direct Known Subclasses
DatagramObject, EvmaTCPServer, LoopbreakReader, StreamObject
Instance Attribute Summary collapse
-
#io ⇒ Object
readonly
Returns the value of attribute io.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
- #close_scheduled? ⇒ Boolean
- #get_peername ⇒ Object
-
#initialize(io) ⇒ Selectable
constructor
A new instance of Selectable.
- #select_for_reading? ⇒ Boolean
- #select_for_writing? ⇒ Boolean
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
#io ⇒ Object (readonly)
Returns the value of attribute io.
325 326 327 |
# File 'lib/pr_eventmachine.rb', line 325 def io @io end |
#uuid ⇒ Object (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
342 343 344 |
# File 'lib/pr_eventmachine.rb', line 342 def close_scheduled? @close_scheduled end |
#get_peername ⇒ Object
354 355 356 |
# File 'lib/pr_eventmachine.rb', line 354 def get_peername nil end |
#select_for_reading? ⇒ Boolean
346 347 348 |
# File 'lib/pr_eventmachine.rb', line 346 def select_for_reading? false end |
#select_for_writing? ⇒ Boolean
350 351 352 |
# File 'lib/pr_eventmachine.rb', line 350 def select_for_writing? false end |