1 28 package org.jruby; 29 30 import org.jruby.runtime.Block; 31 import org.jruby.runtime.CallbackFactory; 32 import org.jruby.runtime.builtin.IRubyObject; 33 34 39 public class RubyContinuation { 40 public static void createContinuation(Ruby runtime) { 41 RubyModule cContinuation = runtime.defineClass("Continuation",runtime.getObject(),runtime.getObject().getAllocator()); 42 CallbackFactory cf = runtime.callbackFactory(RubyContinuation.class); 43 cContinuation.defineMethod("call", cf.getOptSingletonMethod("call")); 44 cContinuation.defineAlias("[]","call"); 45 } 46 47 public static IRubyObject call(IRubyObject recv, IRubyObject[] args, Block unusedBlock) { 48 recv.getRuntime().getWarnings().warn("Continuation#call: Continuations are not implemented in JRuby and will not work"); 49 return recv.getRuntime().getNil(); 50 } 51 } | Popular Tags |