Suggestions wanted - customized ruby http server

S

snacktime

------=_Part_7710_25519142.1127200572659
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I'm looking at the options available in ruby to replace an ajax driven=20
client/server application in perl. The application is an interface to the=
=20
asterisk manager api. You can see=20
http://www.voip-info.org/tiki-index.php?page=3DAsterisk+Manager+API for mor=
e=20
information on the api.

The perl application runs a small webserver and monitors asterisk for=20
events, sticking new events into a queue for clients to retrieve. The clien=
t=20
uses ajax to poll the server every few seconds, get any waiting event=20
messages, and possibly send commands to be passed on to asterisk. Right now=
=20
the perl app is written in POE, a perl event driven framework.

The httpd component needs to be able to service multiple simultaneous=20
requests (although not a lot). The asterisk component will only need to ope=
n=20
a single long lasting connection to a single asterisk server. Both=20
components will need some type of message queue to pass messages back and=
=20
forth.

My first thought is to just use rails for the web component, a custom tcp=
=20
client/server for the asterisk component, and drb for the communication=20
between the two. For the message queue I could probably just use arrays to=
=20
build simple FIFO lists for incoming and outgoing messages.

Any thoughts?

------=_Part_7710_25519142.1127200572659--
 
R

Robert Klemme

snacktime said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top