Class: ApplicationInterface
- Inherits:
-
Object
- Object
- ApplicationInterface
- Defined in:
- lib/server/application_interface.rb
Instance Method Summary collapse
-
#initialize(pty_m) ⇒ ApplicationInterface
constructor
A new instance of ApplicationInterface.
- #push(key) ⇒ Object (also: #<<)
- #start_worker ⇒ Object
Constructor Details
#initialize(pty_m) ⇒ ApplicationInterface
Returns a new instance of ApplicationInterface.
4 5 6 7 8 |
# File 'lib/server/application_interface.rb', line 4 def initialize pty_m @pty_m = pty_m @queue = Queue.new start_worker end |
Instance Method Details
#push(key) ⇒ Object Also known as: <<
10 11 12 |
# File 'lib/server/application_interface.rb', line 10 def push key @queue << key end |
#start_worker ⇒ Object
15 16 17 18 19 |
# File 'lib/server/application_interface.rb', line 15 def start_worker Thread.new do loop { @pty_m << @queue.pop } end end |