Is there a Thin equivalent for JRuby?

I recently started reading about the Thin webserver and the evented
model it supports. For some stuff we are doing here I would like to
investigate this further but with JRuby. Some examples I’ve seen with
Thin show that you can build an App (say with sinatra) that allows you
to use EventMachine and deferred responses. The deferred response
concept is pretty interesting but I’m still trying to wrap my head
around it. I was wondering if anyone (with more knowledge than I)
knows if I can achieve the deferred response capability on a Java web
server (such as glassfish or whatever). I realize that Glassfish and
Jboss etc support NIO but I’m not yet clear on how NIO feeds into the
ability to do deferred responses.

I’ve been googling around and I feel like I might be missing
something. So I thought I’d ask :slight_smile:

Thanks!
Jay


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Glassfish can do comet which is similar. I’ve seen samples in java but
not
ruby, you could probably massage the examples

http://weblogs.java.net/blog/2006/10/31/writing-comet-web-application-using-glassfish

~Matt

also check out atmosphere

https://atmosphere.dev.java.net/

On Thu, Dec 3, 2009 at 10:02 AM, Matthew K. [email protected]
wrote:

model it supports. For some stuff we are doing here I would like to
I’ve been googling around and I feel like I might be missing


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I’m working on one - not sure if it will meet your needs or not. It’s
not quite ready for prime time, but it’s getting close.
http://github.com/kevwil/aspen

Stephen B. wrote:

Kevin,

Aspen looks pretty interesting.

I downloaded the repo and after a bunch of trouble getting bones
installed properly:

see: http://github.com/TwP/bones/issues/#issue/2

I built and installed the gem into my local jruby.

When I tried to run the lobster example lib/aspen/server.rb:1 generates
an error trying to require ‘g’.

What is ‘g’?

Stephen,

‘g’ is http://gemcutter.org/gems/g Actually, I forgot to delete those
references when I merged from my refactoring branch. Those are just
there for testing.

Yeah, Aspen isn’t quite ready to be used. Most of the functionality is
there, but there’s still quite a bit of polishing and testing to be
done. Sorry about the Bones trouble, I’m still trying to figure out the
best way to use it without causing trouble for others.

Cheers,

Kevin

At 10:25 PM +0100 12/5/09, Kevin W. wrote:

I’m working on one - not sure if it will meet your needs or not. It’s
not quite ready for prime time, but it’s getting close.
http://github.com/kevwil/aspen

Kevin,

Aspen looks pretty interesting.

I downloaded the repo and after a bunch of trouble getting bones
installed properly:

see: http://github.com/TwP/bones/issues/#issue/2

I built and installed the gem into my local jruby.

When I tried to run the lobster example lib/aspen/server.rb:1 generates
an error trying to require ‘g’.

What is ‘g’?

details …

[examples (master)]$ jruby lobster-java.rb
/Users/stephen/dev/test/jruby-git/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require': no such file to load -- g (LoadError) from /Users/stephen/dev/test/jruby-git/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
from
/Users/stephen/dev/test/jruby-git/lib/ruby/gems/1.8/gems/aspen-1.0.0/lib/aspen/server.rb:1
from
/Users/stephen/dev/test/jruby-git/lib/ruby/gems/1.8/gems/aspen-1.0.0/lib/aspen/server.rb:12


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I built and installed the gem into my local jruby.
there for testing.
OK, now I’ve been able to successfully run:

java:build
gem:package

Installed aspen into jruby’s gem repo

FYI: Had to read the instructions here to get ‘g’ and ruby-growl
working:

http://segment7.net/projects/ruby/growl/

First you need to enable “Listen for incoming notifications” and
“Allow
remote application registration” on the Network tab of the Growl
Preference
Panel to send Growl Notifications from ruby-growl. You’ll probably
also
want to set a “UDP password” as well.

That’s very nice.

Am now in the gems example dir and can run lobster-java.rb

but am getting a 404: “Not Found: /”

[examples (master)]$ jruby lobster-java.rb

Aspen web server (aspen 1.0.0)
Listening on localhost:8080, CTRL+C to stop

      • [06/Dec/2009 11:21:13] "GET / " 404 12 0.0100

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Am now in the gems example dir and can run lobster-java.rb

but am getting a 404: “Not Found: /”

[examples (master)]$ jruby lobster-java.rb

Aspen web server (aspen 1.0.0)
Listening on localhost:8080, CTRL+C to stop

      • [06/Dec/2009 11:21:13] "GET / " 404 12 0.0100

I say to myself (just after sending the last email) “When all else fails
… read the fine instructions” :wink:

examples/lobster.rb:17

map ‘/fish’ do
run ::Rack::Lobster.new
end

Now: http://localhost:8080/fish works :wink:

                       ,.---._
             ,,,,     /       `,
              \\\\   /    '\_  ;
               |||| /\/``-.__\;'
               ::::/\/_

{{-.__.-'((^^(^^^(^ 9 .=========' {{{{{{ { ( ( ( ( (-----:= {{.-'~~'-.(,(,,(,,,(__6_.'=========. ::::\/\ |||| \/\ ,-'/, //// \ `` _/ ; '''' \ .’
`—’
That’s nice – now I can try and break aspen more creatively!


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Stephen B. wrote:

Now: http://localhost:8080/fish works :wink:

                       ,.---._
             ,,,,     /       `,
              \\\\   /    '\_  ;
               |||| /\/``-.__\;'
               ::::/\/_

{{-.__.-'((^^(^^^(^ 9 .=========' {{{{{{ { ( ( ( ( (-----:= {{.-'~~'-.(,(,,(,,,(__6_.'=========. ::::\/\ |||| \/\ ,-'/, //// \ `` _/ ; '''' \ .’
`—’
That’s nice – now I can try and break aspen more creatively!

I welcome your feedback! Just don’t be surprised if Rails doesn’t run
yet. :slight_smile:


De : Jay McGaffigan [email protected]
À : [email protected]
Envoyé le : Dim 6 Décembre 2009, 18 h 28 min 03 s
Objet : Re: [jruby-user] Re: getting aspen working, was: Is there a Thin
equivalent f

thanks… I am going to check this out tomorrow. We have need of an
evented server with Async/Deferred responses… So I’d be happy to
prototype with this and submit patches.

Jay

On Sun, Dec 6, 2009 at 11:46 AM, Kevin W. [email protected]
wrote:

{{{{{{ { ( ( ( ( (-----:=

Posted via http://www.ruby-forum.com/.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

thanks… I am going to check this out tomorrow. We have need of an
evented server with Async/Deferred responses… So I’d be happy to
prototype with this and submit patches.

Jay

On Sun, Dec 6, 2009 at 11:46 AM, Kevin W. [email protected]
wrote:

{{{{{{ { ( ( ( ( (-----:=

Posted via http://www.ruby-forum.com/.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Kevin W. wrote:

Stephen B. wrote:

Now: http://localhost:8080/fish works :wink:

                       ,.---._
             ,,,,     /       `,
              \\\\   /    '\_  ;
               |||| /\/``-.__\;'
               ::::/\/_

{{-.__.-'((^^(^^^(^ 9 .=========' {{{{{{ { ( ( ( ( (-----:= {{.-'~~'-.(,(,,(,,,(__6_.'=========. ::::\/\ |||| \/\ ,-'/, //// \ `` _/ ; '''' \ .’
`—’
That’s nice – now I can try and break aspen more creatively!

I welcome your feedback! Just don’t be surprised if Rails doesn’t run
yet. :slight_smile:

@Kevin: I am planning to port my ruby/thin/sinatra based app to
jruby/aspen/sinatra.
Under thin I am using eventmachine’s API to register my own UDP listener
sockets.
Are there any examples I can peek at on how to achieve the same using
aspen/netty ?

Christian Guenther wrote:

@Kevin: I am planning to port my ruby/thin/sinatra based app to
jruby/aspen/sinatra.
Under thin I am using eventmachine’s API to register my own UDP listener
sockets.
Are there any examples I can peek at on how to achieve the same using
aspen/netty ?

Sorry, I haven’t got that far with Aspen yet. I want to get Aspen
working on TCP smoothly before I expand to other features.