Skip to content

Instantly share code, notes, and snippets.

@skwp
Created August 3, 2008 22:51
Show Gist options
  • Save skwp/3846 to your computer and use it in GitHub Desktop.
Save skwp/3846 to your computer and use it in GitHub Desktop.
class ThreadFactory
if ENV['RAILS_ENV'] == 'development'
class FakeThread
def initialize(&block)
block.call
end
end
def initialize(&block)
FakeThread.new(&block)
end
else
def initialize(&block)
Thread.new(&block)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment