Lightweight MVC Ruby framework and LS?

aemadrid

Well-Known Member
#1
I have been working with Rails for the last 2 yearsand it's been great. Nevertheless, I am looking for a lightweight MVC Ruby framework that integrates well with LS. Looking around I found Merb which seems to fit what I'm looking for just right although the integration with LS through the LSAPI does not seem obvious or even possible. My problem is that I love how the LSAPI forks children on a need to use basis without my undivided attention and Merb (and Mongrel for that matter) like to do their own thing. Am I missing something? Is there an easy way to get both the LSAPI hookup and lightweight Rails mojo at the same time? Any ideas?

Thanks in advance,


AEM
 

mistwang

LiteSpeed Staff
#2
I think it is possible, LSAPI is a communication protocol between LSWS and ruby, should be able to run anything on top of that.

The hook between LSAPI and any ruby web application should be very simple, just take a look at our RailsRunner.rb. You can try make a hook to the Merb in pure ruby.
 

aemadrid

Well-Known Member
#3
Wrapping

I'm trying to figure it out. Merb is basically a large HttpHandler for Mongrel and from what I read in the Wiki the only way to run Mongrel is through proxying. For fun I'm going to try to run an skeleton Merb app and try to run:

Code:
while LSAPI.accept != nil
  Merb::Server.run
end
Something tells me it's going to break but we'll see. Another approach came from looking at the LSAPI examples. What if I could take the guts of Mongrel for URL parsing and do my own processing ala Merb there. I don't know, seems like a lot of work but we'll see.

Thanks!


AEM


I think it is possible, LSAPI is a communication protocol between LSWS and ruby, should be able to run anything on top of that.

The hook between LSAPI and any ruby web application should be very simple, just take a look at our RailsRunner.rb. You can try make a hook to the Merb in pure ruby.
 

mistwang

LiteSpeed Staff
#4
You can safely assume it is a persistent CGI container, all CGI environment variables is available. On top of that, you can craft a Mongrel HttpHandler object and make Merb think it is running under Mongrel. ;)
 

aemadrid

Well-Known Member
#5
Thanks for for the info. I tried getting Merb to run using the LSAPI but it didn't work. Nevertheless, I'm going forward with starting from scratch using the standard cgi libraries. I'm loving the performance so far. We'll see how it does at the end of the project.

Thanks again,


Adrian Madrid

You can safely assume it is a persistent CGI container, all CGI environment variables is available. On top of that, you can craft a Mongrel HttpHandler object and make Merb think it is running under Mongrel. ;)
 
Top