class QMachineService

Public Instance Methods

hang_up() click to toggle source

This block defines “subfunctions” for use inside the route definitions. The most important ones are the three functions for interacting with persistent storage: ‘get_avar`, `get_list`, and `set_avar`. Those three functions are not defined here – they are defined separately in modules that are loaded at runtime by `QM::launch_service`.

# File lib/qm/service.rb, line 93
def hang_up
  # This helper literally "hangs up" on the request by immediately
  # halting further processing, responding with a nondescript 444
  # status code and an empty body, and then closing the connection.
  # Unfortunately, closing the connection in this way caused problems
  # in the Node.js implementation, which suggests that this is not the
  # correct solution for all concurrency models ... argh.
    headers = {'Connection' => 'close', 'Content-Type' => 'text/plain'}
    halt [444, headers, ['']]
end
log_to_db() click to toggle source
# File lib/qm/service.rb, line 104
def log_to_db()
  # This helper function needs documentation.
    settings.log_db.log(request)
end