Closed ramarnat closed 11 years ago
There's no way to spawn a subprocess using a block of code under JRuby, even with the spoon gem. However, it should be simple to replace this code with a thread that runs the logic and then terminates itself. You'd get the same concurrency without spawning.
thanks for the quick reply!
the workers need to run as separate processes, so I think I will follow the pattern laid out by foreman by using a runner as laid out here - https://github.com/ddollar/foreman/pull/140
Looking down another path, I found your gist https://gist.github.com/headius/1378616
But it doesn't work in 1.7.4, expected?
got further by using java.util.concurrent.ThreadPoolExecutor as you suggested, but now looks like I hit a wall with this JRuby bug - http://jira.codehaus.org/browse/JRUBY-7188
giving up and going back to MRI for now :(
I am looking to update some code that uses fork so it's compatible with JRuby. The code runs a fork with a block of code, how do I accomplish the same functionality with spoon? I think I have to kick off another jruby instance, but how do I have it hone in on running a particular block?
This is from the aws simple workflow sdk btw.