snacktime wrote:
> I'm looking at the options available in ruby to replace an ajax driven
> client/server application in perl. The application is an interface to
> the asterisk manager api. You can see
> http://www.voip-info.org/tiki-index.php?page=Asterisk+Manager+API for
> more information on the api.
>
> The perl application runs a small webserver and monitors asterisk for
> events, sticking new events into a queue for clients to retrieve. The
> client uses ajax to poll the server every few seconds, get any
> waiting event messages, and possibly send commands to be passed on to
> asterisk. Right now the perl app is written in POE, a perl event
> driven framework.
>
> The httpd component needs to be able to service multiple simultaneous
> requests (although not a lot). The asterisk component will only need
> to open a single long lasting connection to a single asterisk server.
> Both components will need some type of message queue to pass messages
> back and forth.
>
> My first thought is to just use rails for the web component,

Do you actually need HTML output or do you just use HTTP as transport
protocol.  In case of the latter I'd probably just use Webrick with a
custom request handler.

> a custom
> tcp client/server for the asterisk component, and drb for the
> communication between the two.

From what you wrote it's not clear to me why you would want to have two
processes.  IMHO a single process seems sufficient.  But I may overlook
somthing here.

> For the message queue I could probably
> just use arrays to build simple FIFO lists for incoming and outgoing
> messages.

There is a class Queue which is thread safe.  You can use that to
communicate between a worker thread that deals with the backend and the
threads serving requests.

Kind regards

    robert