Class: EventMachine::Synchrony::Keyboard

Inherits:
Object
  • Object
show all
Defined in:
lib/em-synchrony/keyboard.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_fiberObject (readonly)

Returns the value of attribute current_fiber.



4
5
6
# File 'lib/em-synchrony/keyboard.rb', line 4

def current_fiber
  @current_fiber
end

#separatorObject (readonly)

Returns the value of attribute separator.



4
5
6
# File 'lib/em-synchrony/keyboard.rb', line 4

def separator
  @separator
end

Instance Method Details

#getsObject



6
7
8
9
10
11
# File 'lib/em-synchrony/keyboard.rb', line 6

def gets
  @current_fiber = Fiber.current        
  EM.open_keyboard(EventMachine::Synchrony::KeyboardHandler, self)
  
  Fiber.yield
end