Skip to content

Instantly share code, notes, and snippets.

@nviennot
Created November 5, 2014 06:16
Show Gist options
  • Save nviennot/3c7eeccb3b2e4d65dc0b to your computer and use it in GitHub Desktop.
Save nviennot/3c7eeccb3b2e4d65dc0b to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rethinkdb'
include RethinkDB::Shortcuts
10.times.map do |i|
Thread.new do
begin
db = i.to_s
c = r.connect(:host => 'localhost', :port => 28015, :db => db).repl
100.times do
r.db_drop(db).run(c) rescue nil
r.db_create(db).run(c)
r.table_create('table').run(c)
print '.'
end
rescue Exception => e
puts e
exit
end
end
end.each(&:join)
puts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment