#13 open
Kevin Williams

get working on JRuby

Reported by Kevin Williams | January 20th, 2008 @ 12:52 PM | in Waiting for EM

discussed/requested on #thin

need ragel to output java, need to port thin.c to java(?), need to use either pure ruby version of EM or new java version of EM, or perhaps http://mina.apache.org/ for sockets

Comments and changes to this ticket

  • macournoyer

    macournoyer January 20th, 2008 @ 04:10 PM

    • → State changed from “new” to “hold”

    How many ppl are gonna use this?

    I'm reluctant to do to this because it will require maintaining twice more code, in 2 languages. Mongrel already has a Java parser but we need to port all the changes to it. Plus I'm porting some parts of response writing to C. Writing extensions is already painful, writing it in 2 languages will be even more.

    If you'd like to use Thin on JRuby in production +1 the ticket. I'm putting on hold until I see lots of interest.

  • gary

    gary February 18th, 2008 @ 09:39 PM

    +1 - We're using JRuby and looking for the best way to deploy. Thin looks great but it would have to support jRuby.

  • Kevin Williams

    Kevin Williams February 18th, 2008 @ 09:53 PM

    I'm still trying to get Ruby allowed at work, and JRuby is probably the runtime I'd have to use. Count me a +1 vote.

    EM (trunk) has a java version, Rack seems to install OK on JRuby, so I imagine the parser is the only piece not already there. It seems it wouldn't be too much work to port the Mongrel java parser.

    I've started playing with this today, but MacPorts has Ragel 6.0, which has breaking changes from older versions, so the *.rl files from Mongrel don't work.

  • macournoyer

    macournoyer February 18th, 2008 @ 10:42 PM

    • → Milestone changed from “1.0” to “Future”

    I''m using Ragel 5.24, which I installed from source.

    This is clearly doable and since the parser doesn't change that much.

    But I wonder how EM performs on jruby. Anyone did some benchmarks?

  • alan

    alan February 22nd, 2008 @ 07:21 PM

    +1 ... considering the newest jruby smokes and has good gem compatibility at the moment. It seems ruby 1.9 is a ways off from real world usage, and many poor development souls stuck at companies, locked into using many jars can get the best of both worlds for internal / externals, while avoiding dirty, dirty java.

  • Kevin Williams

    Kevin Williams February 24th, 2008 @ 09:41 AM

    we need EM to release for jruby before we can do anything.

  • macournoyer

    macournoyer February 25th, 2008 @ 05:00 PM

    • → Milestone changed from “Future” to “1.0”
    • → State changed from “hold” to “open”
    • → Assigned user changed from “” to “Kevin Williams”
  • macournoyer

    macournoyer July 1st, 2008 @ 09:49 AM

    • → Tag changed from “” to “java jruby platform”
    • → Milestone changed from “1.0” to “Waiting for EM”

    I red they are working on it right now

  • Kevin Williams
  • Kevin Williams

    Kevin Williams August 26th, 2008 @ 05:05 PM

    I'm working on a java-based backend for Thin. Not sure how it's going to work out because Thin depends on EM for more than just the backend. If we can divorce Thin from EM and constrain EM to backend code, then Thin on JRuby might really rock.

  • macournoyer

    macournoyer August 27th, 2008 @ 01:29 PM

    Aman sent me this:

    fyi, i got the java reactor working

    http://github.com/tmm1/eventmach...

    ran some of my EM libraries through it and it seems to work without modifications or problems

    Aman

    ===

    @kevin: Thin should not depend on EM anymore, only Backends::Base does depend on it. thin-turbo is a non-EM backend and is works fine.

  • Kevin Williams

    Kevin Williams August 27th, 2008 @ 01:40 PM

    lib/thin.rb requires EM, and lib/thin/connection.rb has the Connection class extending EventMachine::Connection. Am I not looking at the right branch or something? I admit I haven't tried running Thin on JRuby without EM installed, but I didn't think I could yet. What am I missing?

  • macournoyer

    macournoyer August 28th, 2008 @ 12:03 PM

    ah right, we can fix that by require all things EM in the Backends::Base, so it it's not loaded EM will not be required.

    Hm, but we'll need to tweak the gem to require EM gem only on non-jruby installation.

    Any better way to make EM optional?

  • Kevin Williams

    Kevin Williams August 28th, 2008 @ 12:14 PM

    Perhaps have a safe alternate backend based on webrick or mongrel? The backend selection code could try to load the EM gem and choose a different backend if not found.

    That would probably mean creating an explicit EM backend, rather that putting EM stuff in Backends::Base.

  • pietia

    pietia December 22nd, 2008 @ 03:30 PM

    hello,

    How is going work with jruby support ? I saw java version of EM.

  • Kevin Williams

    Kevin Williams December 22nd, 2008 @ 04:02 PM

    EM for JRuby isn't formally released, so I haven't tried to do anything yet. I'm continuing to working on getting something based on Mina to work. Almost got it now, just trying to figure out Rack and plugging the two together.

  • pietia

    pietia December 22nd, 2008 @ 04:27 PM

    Which version of Mine? Is your code available via net?

  • Kevin Williams

    Kevin Williams December 22nd, 2008 @ 04:28 PM

    The latest version of Mina - no, I haven't released it yet.

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »