Class: ApplicationInterface

Inherits:
Object
  • Object
show all
Defined in:
lib/server/application_interface.rb

Instance Method Summary collapse

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_workerObject



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