Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

get working on JRuby

#13

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

Reported by Kevin Williams · January 20th, 2008 @ 12:52 PM

State: open
Milestone: Future
Assigned to: Kevin Williams Kevin Williams

Activity

  1. macournoyer
    macournoyer
    • 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.

    January 20th, 2008 @ 04:10 PM

  2. Kevin Williams
    Kevin Williams

    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.

    February 18th, 2008 @ 09:53 PM

  3. macournoyer
    macournoyer
    • 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?

    February 18th, 2008 @ 10:42 PM

  4. Kevin Williams
    Kevin Williams

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

    February 24th, 2008 @ 09:41 AM

  5. macournoyer
    macournoyer
    • Assigned user set to Kevin Williams
    • Milestone changed from Future to 1.0
    • State changed from hold to open

    February 25th, 2008 @ 05:00 PM

  6. macournoyer
    macournoyer
    • Tag set to java, jruby, platform
    • Milestone changed from 1.0 to Waiting for EM

    I red they are working on it right now

    July 1st, 2008 @ 09:49 AM

  7. Kevin Williams
  8. Kevin Williams
    Kevin Williams

    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.

    August 26th, 2008 @ 05:05 PM

  9. macournoyer
    macournoyer

    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.

    August 27th, 2008 @ 01:29 PM

  10. Kevin Williams
    Kevin Williams

    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?

    August 27th, 2008 @ 01:40 PM

  11. macournoyer
    macournoyer

    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?

    August 28th, 2008 @ 12:03 PM

  12. Kevin Williams
    Kevin Williams

    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.

    August 28th, 2008 @ 12:14 PM

  13. Kevin Williams
    Kevin Williams

    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.

    December 22nd, 2008 @ 04:02 PM

  14. Kevin Williams
    Kevin Williams

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

    December 22nd, 2008 @ 04:28 PM

  15. Kevin Williams
    Kevin Williams
    • Milestone changed from Waiting for EM to Future

    Thanks for the update Aman, it did install into my JRuby 1.2.0 install on my laptop. Unfortunately, http://rubyeventmachine.com/wiki... claims it is not officially released yet.

    I'll start working on it now. The first thing I have to do is get the Mongrel parser for Java into Thin and updated with the equivalent code for the ext/thin_parser/thin.c features. This is not familiar ground for me, so it might take a while.

    April 6th, 2009 @ 10:07 AM

  16. Kevin Williams
    Kevin Williams

    I've been dabbling with my Mina (now Netty) based server for years now. I rarely have time to work on it, and when I do, it never works quite right.

    Something very close to what I've been trying to build is https://github.com/matadon/mizuno which uses Jetty. Mizuno seems to work, which is more than I can say for my server. :)

    Now that EventMachine does work on JRuby, perhaps very little is needed to get Thin to work, although the http-parser extension might be a problem. I'd be surprised if it were faster than something more native to Java based on Netty or Jetty, though.

    I don't code in Ruby anymore, and I'm worried about the future of Java in general, so of anyone would like to take this over I'll be happy to hand over responsibility.

    January 13th, 2012 @ 01:42 PM

  17. John
    John

    Κατά την ταπεινή μου γνώμη, οι άνθρωποι σε όλο τον κόσμο λατρεύουν να παίζουν σε online καζίνοΔεν υπάρχουν πολλά μεγάλα online καζίνο. Αν κοιτάξετε το καζίνο Ice Casino, θα δείτε ότι μπορεί να σας βοηθήσει να τελειώσετε μια δουλειά που μισείτε, είπε. Σύμφωνα με τις στατιστικές, αυτό το online καζίνο έχει την υψηλότερη https://icecasino-gr.com/ RTP

    February 28th, 2024 @ 01:30 PM

  18. Kira
    Kira

    Πριν ξεκινήσετε, επιλέξτε τον αριθμό των ενεργών γραμμών και ορίστε το μέγεθος του πονταρίσματος. Το Super Hot Fruits https://superhotfruits.com/ σας επιτρέπει να προσαρμόσετε αυτές τις παραμέτρους ώστε το παιχνίδι να ταιριάζει στο στυλ σας. Ξεκινήστε με ένα μικρό ποντάρισμα για να κατανοήσετε καλύτερα τους μηχανισμούς του κουλοχέρη.

    September 4th, 2024 @ 04:34 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.