dev@grizzly.java.net

Code changes to fix issue in logic of async execution of Jruby

From: Pramod Gopinath <Pramod.Gopinath_at_Sun.COM>
Date: Sun, 24 Feb 2008 19:19:48 -0800

2 Code changes both dealing with the support of asynchronous request
processing (ARP) in grizzly-jruby module.
Think that the current timelimit provided is low, hence changing the
time to be 360 seconds (5 minutes). Not sure if this is large/small
enough. Want to know what you guys feel on that ?
Fixing the logic where the queue poll would not happen if the queue has
been enabled for asynchronous requests.

All the change is in
module/jruby/src/main/java/com/sun/grizzly/jruby/RubyObjectPool.java.

The svn diff is provided below :

Thanks
Pramod Gopinath


pramod-gopinaths-computer:~/work_related/grizzly_code/grizzly/tags/1_7_2/modules/jruby
pramodgopinath$ svn diff
src/main/java/com/sun/grizzly/jruby/RubyObjectPool.java
Index: src/main/java/com/sun/grizzly/jruby/RubyObjectPool.java
===================================================================
--- src/main/java/com/sun/grizzly/jruby/RubyObjectPool.java
(revision 856)
+++ src/main/java/com/sun/grizzly/jruby/RubyObjectPool.java (working
copy)
@@ -44,7 +44,7 @@
 public class RubyObjectPool {
 
     /** How long to wait before given up. */
- private static long DEFAULT_TIMEOUT = 1000L;
+ private static long DEFAULT_TIMEOUT = 360L;
 
     /** JRUBY_LIB directory */
     private String jrubyLib = null;
@@ -70,9 +70,9 @@
      * @return JRuby runtime.
      */
     public Ruby borrowRuntime() {
- if (!isAsyncEnabled()){
+ if (isAsyncEnabled()){
             try {
- return queue.poll(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS);
+ return queue.poll(DEFAULT_TIMEOUT, TimeUnit.SECONDS);
             } catch (InterruptedException e) {
                 throw new RuntimeException(e);
             }