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.
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
#io ⇒ Object (readonly)
Returns the value of attribute io.
314 315 316 |
# File 'lib/pr_eventmachine.rb', line 314 def io @io end |
#uuid ⇒ Object (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
331 332 333 |
# File 'lib/pr_eventmachine.rb', line 331 def close_scheduled? @close_scheduled end |
#get_peername ⇒ Object
343 344 345 |
# File 'lib/pr_eventmachine.rb', line 343 def get_peername nil end |
#select_for_reading? ⇒ Boolean
335 336 337 |
# File 'lib/pr_eventmachine.rb', line 335 def select_for_reading? false end |
#select_for_writing? ⇒ Boolean
339 340 341 |
# File 'lib/pr_eventmachine.rb', line 339 def select_for_writing? false end |