Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sintaxi
Created January 30, 2009 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sintaxi/55287 to your computer and use it in GitHub Desktop.
Save sintaxi/55287 to your computer and use it in GitHub Desktop.
#######################
# Merb.run_later issues
#######################
Here is what I am running.
- Slicehost account
- Ubuntu 8.04
- jruby 1.1.5 (ruby 1.8.6 patchlevel 114) (2008-11-03 rev 7996) [amd64-java]
- glassfish V3 (0.9.1)
- merb-core 1.0.8.1
- merb-helpers 1.0.8.1
I have built an API that processes a bunch of PDFs and PNGs. On create I am
returning some json and then using run_later to process the uploaded file.
this is what my controller looks like...
# POST /morphs
def create
only_provides :js
@morph = Morph.new(params[:morph])
if @morph.save
run_later { @morph.process! }
display @morph
end
end
With glassfish (jruby -S glassfish), the project runs but the "@morph.process!"
command that is in the run_later block does not get called. It a pretty tricky
thing to test but that seems to be my findings so far. when I use mongrel instead
(jruby -S merb), it works as expected. I am not sure if the problem lies with
jruby or with glassfish (or neither). Anyways, I hope this information is useful.
Any tips you have for me would be much appreciated.
-brock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment