Class: LIS::InterfaceServer

Inherits:
Object
  • Object
show all
Defined in:
lib/lis/interface_server.rb

Instance Method Summary (collapse)

Constructor Details

- (InterfaceServer) initialize(port, http_endpoint)

A new instance of InterfaceServer



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/lis/interface_server.rb', line 3

def initialize(port, http_endpoint)
  @server  = PacketIO::IOListener.new(port)
  @packets = LIS::Transfer::ASTM::E1394.new(@server)

  app_protocol = LIS::Transfer::ApplicationProtocol.new(@packets)
  interface    = WorklistManagerInterface.new(http_endpoint)

  app_protocol.on_request do |device_name, barcode|
    interface.load_requests(device_name, barcode)
  end
  app_protocol.on_result do |*args|
    interface.send_result(*args)
  end
end

Instance Method Details

- (Object) run!



18
19
20
21
# File 'lib/lis/interface_server.rb', line 18

def run!
  warn "listener started" if $VERBOSE
  @server.run!
end