Call between controllers

It's unclear to me if these two controllers are running on the same
machine or not since you referenced DRb. If they are running on the
same machine how do you instantiate "AnApplicationController"? That is,
Rails instantiates the controller for each incoming request and from
your example that would appear to be "AuthController".

Could you simply do Of
course, this would require setup and tear down for each invocation.
Another alternative MIGHT be to instantiate it one time and store it in
a class variable. If you have multiple instances of the Ruby
interpreter running on your server though that might not work depending
on the requirements of your application.


Have you considered EventMachine? I have not worked with it yet myself
but it supports SSL and would allow you to setup a socket server in
Ruby to handle the authentication and send a response back to the
client. It's available at Rubyforge. Do a google search on it. I saw
this snippet of code that got me interested in marking it as a tool
that I will likely use when the requirements call for it:

   Create a daemon / server in 11 lines of Ruby

   require 'rubygems'
   require 'eventmachine'

   module EchoServer
     def receive_data(data)
       send_data ">>> You sent: #{data}"
       close_connection if data =~ /quit|exit/i

   EventMachine::run {
     EventMachine::start_server "", 8081, EchoServer