Threads in Ruby? Use JRuby
Threads are an easy way to run background processes or do things concurrently, but the management of threads and shared state can be difficult.
Use JRuby and the java.util.concurrent package. The javadoc is amazing:
http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/package-summary.html
And with JRuby, you can write idiomatic Ruby code that uses all the power provided by the JVM for managing threads and dealing with shared state.
Written by David Copeland
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#